SNMP Monitoring a VPN interface that changes

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: SNMP Monitoring a VPN interface that changes

Post by tacolover101 »

rjesse wrote:Thanks everyone for the tips and samples, I have a working shell script outside of Nagios, I just need to figure out how to get it working inside Nagios as a plugin, some quick learning for me. I'll post my solution when i get it working.
within your shell script, nagios cares about a few things on output -
1. exit code (exit 0)
2. line of text here (echo "OK: TACOS STILL IN FREEZER" | tacos=101) - the first part is the text to be displayed in the nagios page, where as what's after | will be represented as performance data.
3. logic - you need to create logic based on your result somehow to determine what to inform nagios about. exit 0 = ok, exit 1 = warning, exit 2 = critical, exit 3 = unknown. add your echo of text accordingly

good luck!
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: SNMP Monitoring a VPN interface that changes

Post by dwhitfield »

tacolover101 wrote: 3. logic - you need to create logic based on your result somehow to determine what to inform nagios about. exit 0 = ok, exit 1 = warning, exit 2 = critical, exit 3 = unknown. add your echo of text accordingly
Thanks @tacolover101!

One additional, advanced point about the exit codes. You can return other codes if it is useful for you. However, there has been talk of future versions adding additional exit codes. I don't know when/if that will happen, but if you did want to do this, I'd stay away from the lover numbers, else you might have compatibility issues in the future. To be clear, nagios is not going to know what to do with other exit codes, but they might be useful for *you*.
Locked