GJS
April 2, 2005, 1:23am
1
Whilst following the How-to to send an email when a connected UPS goes on battery, I noticed the actual checking of the UPS state is accomplished by checking the value of $on-battery. Is this value set by RouterOS and if so, is there a list somewhere of other global variables that are set up by the system?
Thanks.
Eugene
April 3, 2005, 11:12am
2
:environment print
Regarding the $on-battery variable: I’ve not seen this script, but most likely the variable was explicitly set somewhere before.
GJS
April 3, 2005, 10:56pm
3
[admin@MT] > :environment print
Global Variables
Local Variables
[admin@MT] >
???
The script is here:
http://www.mikrotik.com/docs/ros/2.8/howto/howto
Scroll down to “How to Configure Router to Send E-mails When Power Failure has Occured?”
The value of $on-battery is not set in the script.
Eugene
April 4, 2005, 11:12am
4
This local variable is set automatically by monitor command.
/system ups monitor once do {:environment print}
Eugene
pidybi
February 10, 2021, 12:41pm
5
a similar question: why global variables are not global variables?
mrz
February 10, 2021, 2:52pm
6
They are global, you need to declare them before accessing, read this:
https://wiki.mikrotik.com/wiki/Manual:Scripting#Variables