Community discussions

MikroTik App
 
gcakici
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 60
Joined: Thu Feb 23, 2006 11:44 am

Warning about high connection numbers.

Sat Aug 26, 2006 11:48 pm

This two lines are working on the command line if executed consequently. But if i use it as a script and run it it doesn't work. And also it causes to run one of my on reboot script. Any ideas ?

:local abcd ([/ip firewall connection print count-only ])

:if ($abcd > 1000) do [/tool e-mail send to="gokalp@......." subject="too many connections" body=($abcd)]
 
User avatar
Eugene
Forum Veteran
Forum Veteran
Posts: 986
Joined: Mon May 31, 2004 5:06 pm
Location: Cranfield, UK

Mon Aug 28, 2006 12:45 pm

"print" does not work in scripts.

Eugene
 
eflanery
Member
Member
Posts: 376
Joined: Fri May 28, 2004 10:11 pm
Location: Moscow, ID
Contact:

Mon Aug 28, 2006 8:22 pm

Try this:
:local abcd [:len [/ip firewall connection find]]
--Eric
 
gcakici
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 60
Joined: Thu Feb 23, 2006 11:44 am

Mon Aug 28, 2006 10:32 pm

Thanks Eric. I appreciate it.

Gokalp
 
sten
Forum Veteran
Forum Veteran
Posts: 919
Joined: Tue Jun 01, 2004 12:10 pm

Tue Aug 29, 2006 7:41 pm

"print" does not work in scripts.

Eugene
would it be terribly hard to change this?
i would like running scripts as sort of macros. somewhat simpler than pasting or doing / import script.rsc

what can't scheduler et al pipe the script output to /dev/null so to speak and allow commandline to see the output?
is it because the script enterpreter is started as a standalone process?
 
User avatar
Eugene
Forum Veteran
Forum Veteran
Posts: 986
Joined: Mon May 31, 2004 5:06 pm
Location: Cranfield, UK

Wed Aug 30, 2006 2:13 pm

That's because output from "print" could not be reliably parsed in all cases by the script interpreter.
There are "find" and "get" commands, which replace "print" in scripts.

Eugene

Who is online

Users browsing this forum: No registered users and 47 guests