is there a list of common variables that can be used for creating monitors with uptime?
i.e., when i build a service check for a script of mine, i'd like to run ./script.sh $hostname, instead of manually defining the hostname on each device.
also, can i run a script as an alternate user?
There are a few sets of variables up.time uses depending on what type of custom monitor you're creating – custom or custom with retained data.
Information pertaining to these types of custom monitors can be found on our knowledge base in the following articles:
The following are the variables sent by the monitoring station containing the hostname information:
For custom monitors:$1
For custom with retained data monitors:$UPTIME_HOSTNAME
If you'd like to list all of the variables passed to a script, just add a line containing:
set >> tmp.txt
This will echo all variables and args currently in use to tmp.txt in your your scripts/ folder.
You could include a 'sudo', an 'su' or a 'fakeroot' in your script
su username -c “/path/to/script.sh”
Powered by IDERA