Is alerting IF older versions of NCPA detected

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Keystone
Posts: 28
Joined: Wed Jan 17, 2018 12:09 pm

Is alerting IF older versions of NCPA detected

Post by Keystone »

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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Is alerting IF older versions of NCPA detected

Post by lmiltchev »

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.

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
fi
You can run it from the CLI as such:

Code: Select all

./check_ncpa_version.sh <client ip> <token>
It is not "ideal" but it could probably get you started.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Keystone
Posts: 28
Joined: Wed Jan 17, 2018 12:09 pm

Re: Is alerting IF older versions of NCPA detected

Post by Keystone »

Thank you for the fast response.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Is alerting IF older versions of NCPA detected

Post by lmiltchev »

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!
Locked