We are going through the upgrade from 2.1.1 to 2.1.6 on thousands of boxes and I would like a way to alert if by chance a box is missed or if an older version gets installed on a new box.
I see here:
https://www.nagios.org/ncpa/help.php#ap ... parameters
That it states:
You cannot use any special parameters on this module. This module is just for getting system information.
I need to verify that if we want this type of check/alerting if an older NCPA version is detected, we would be REQUIRED to create a custom script.
Is alerting IF older versions of NCPA detected
Re: Is alerting IF older versions of NCPA detected
Unfortunately, you are correct. You cannot pass a parameter to check the version number and set an alert. You would have to use a custom script. This is an example of a simple bash script that you could use.
You can run it from the CLI as such:
It is not "ideal" but it could probably get you started.
Code: Select all
#!/bin/bash
ncpa_version=`/usr/local/nagios/libexec/check_ncpa.py -H $1 -t $2 -P 5693 -M system/agent_version | cut -d ' ' -f4 | tr -d "'[]'"`
echo $ncpa_version
if [ $ncpa_version != "2.1.6" ]; then
echo "CRITICAL: NCPA agent was not updated!"
exit 2
else
echo "OK: NCPA agen is up to date."
exit 0
fiCode: Select all
./check_ncpa_version.sh <client ip> <token>Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Is alerting IF older versions of NCPA detected
Thank you for the fast response.
Re: Is alerting IF older versions of NCPA detected
You are welcome! I am closing this topic now. If you have any further questions, please start a new thread. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!