Forum Discussion
Gary_31854
Mar 26, 2014Nimbostratus
Variables in an external monitor BASH script
Greetings,
I have written a shell script to use as an external monitor. It works as expected when I execute it from the bash shell, but fails as a monitor. I believe the reason for the failure is t...
Gary_31854
Mar 27, 2014Nimbostratus
I was unable to attach the full script to this thread. I put it up on pastebin --> http://pastebin.com/PMwFXs5z .
The backticks and missing variables are defined. It does work when executed from the CLI. Here is the piece of code again with the preformatted code view.
Full path variables to commands used in the script
CURL='/usr/bin/curl'
GREP='/bin/grep'
TMSH='/usr/bin/tmsh'
LOGGER='/bin/logger'
IP addresses of the VCS members
VCS1='10.12.1.11'
VCS2='10.12.1.12'
Debug flag
DEBUG=1
TMSH list the content of snat definition snat_ids_primary, and look for
the VCS IP addresses to store them in the $PRI variable. If the VCS are
not in the primary SNAT, $PRI should be empty.
PRI=`$TMSH list ltm snat snat_ids_primary | $GREP -E "$VCS1|$VCS2"`
if [ "$DEBUG" -eq 1 ]; then echo "IDS_SNAT: Result of Primary SNAT check -> $PRI" | $LOGGER -p local0.debug; fi
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects