Warning about high connection numbers.

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)]

“print” does not work in scripts.

Eugene

Try this:

:local abcd [:len [/ip firewall connection find]]

–Eric

Thanks Eric. I appreciate it.

Gokalp

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?

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