Service Monitoring checks are failing after NCPA 2.1.1

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Sampath.Basireddy
Posts: 252
Joined: Wed Dec 14, 2016 12:30 pm

Service Monitoring checks are failing after NCPA 2.1.1

Post by Sampath.Basireddy »

Hello There,

We started seeing Service Monitoring Checks are failing with error “The node (service) requested does not exist. You may be trying to access the 'services' node.” after NCPA 2.1.1 upgrade. I did found another topic on the forum to modify the service check parameters as below and it should work.

Code: Select all

-t 'yourtoken' -P 5693 -M 'services' -q 'service=<service name>,status=running'
I modified the service check and it worked fine. But the problem is, we have more than few 100s of Service Monitoring Checks in our environent and am not sure if there is an automated way to update all the service checks.

Please suggest ASAP as we have many service checks currently failing.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Service Monitoring checks are failing after NCPA 2.1.1

Post by npolovenko »

Hello, @Sampath.Basireddy. The solution here is to upgrade the NCPA wizard in Nagios XI. Go to the Admin menu, then under System Extensions click on Manage Config Wizards. In that menu click on Check for Updates. Then scroll down to NCPA wizard and click on Update button next to it.
Ok, now you should have NCPA wizard version 1.5.3. To fix your problem you'd need to rerun the wizard against the same host name, and select the same services. But, before you do that:
1. Open /usr/local/nagiosxi/html/includes/configwizards/ncpa/ncpa.inc.php
2. On the line #829 change

Code: Select all

"service_description" => "Service status for: " . $service["name"],
to

Code: Select all

"service_description" => "Service status: " . $service["name"],
3. Exit and save

Now rerun the wizard and it will replace and update all the services with the right syntax.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Sampath.Basireddy
Posts: 252
Joined: Wed Dec 14, 2016 12:30 pm

Re: Service Monitoring checks are failing after NCPA 2.1.1

Post by Sampath.Basireddy »

Hello @npolovenko,

What do you mean by "To fix your problem you'd need to rerun the wizard against the same host name, and select the same services.".

Does that mean I need to run "NCPA Configuration" Wizard on all the hosts that are having Service Monitoring Checks?

If that is what you are suggesting to do to fix this issue, please understand that we have more than few hundreds of service monitoring checks which are spread across many hosts(~2500).

I don't think running config wizard on approximately 300-500+ Hosts and re-configuring monitoring is practical.

There should be backwards compatible option. Please check and let me know.

Thank You,
Sampath.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Service Monitoring checks are failing after NCPA 2.1.1

Post by npolovenko »

@Sampath.Basireddy, I see your problem. We found a solution using 'sed replace'. But before you do anything please make a full backup of your XI, or even better try this in a test environment first. Here are the commands to run:

Code: Select all

mkdir /backup
cp /usr/local/nagios/etc/services/* /backup
cp /usr/local/nagios/etc/services/* /usr/local/nagios/etc/import/
find /usr/local/nagios/etc/import/ -type f -exec sed -i "s/-M 'service\//-M 'services' -q 'service=/g" {} +
find /usr/local/nagios/etc/import/ -type f -exec sed -i "s/\/running/,status=running/g" {} +
cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh
That should replace the old syntax in all NCPA checks. Let us know how it worked for you.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Sampath.Basireddy
Posts: 252
Joined: Wed Dec 14, 2016 12:30 pm

Re: Service Monitoring checks are failing after NCPA 2.1.1

Post by Sampath.Basireddy »

@npolovenko, Thank You for the instructions.

We do not have a test instance in our environment. Would it be possible to copy just a few service check cfg files and execute the commands to see if that updates those few service checks and then take it forward?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Service Monitoring checks are failing after NCPA 2.1.1

Post by npolovenko »

@Sampath.Basireddy, Yes, you could use these commands to try this out on a few cfg's:

Code: Select all

cd /usr/local/nagios/etc/services
cp file1.cfg file2.cfg file3.cfg /usr/local/nagios/etc/import/
find /usr/local/nagios/etc/import/ -type f -exec sed -i "s/-M 'service\//-M 'services' -q 'service=/g" {} +
find /usr/local/nagios/etc/import/ -type f -exec sed -i "s/\/running/,status=running/g" {} +
cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh
Just replace the file1.cfg file2.cfg file3.cfg with some service_check cfg's in the /usr/local/nagios/etc/services folder.

Let us know how it goes.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Sampath.Basireddy
Posts: 252
Joined: Wed Dec 14, 2016 12:30 pm

Re: Service Monitoring checks are failing after NCPA 2.1.1

Post by Sampath.Basireddy »

I tried the suggested steps are its working fine now. Can you please give me the syntax for Process Monitoring also. Appears Process Monitoring too are having the same problem.

This is the current syntax in Process Monitoring Service Check:

Code: Select all

-t password -P 5693 -M 'process/processname/count' -c 1:
Please let me know if I need to open a different topic for Process Monitoring and I can open one.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service Monitoring checks are failing after NCPA 2.1.1

Post by lmiltchev »

Try the following:

Code: Select all

cd /usr/local/nagios/etc/services/
cp file1.cfg file2.cfg file3.cfg /usr/local/nagios/etc/import/
find /usr/local/nagios/etc/import -type f -exec sed -i "s/-M 'process\//-M 'processes' -q 'name=/g" {} +
find /usr/local/nagios/etc/import -type f -exec sed -i "s/\/count'/,match=search,check=true'/g" {} +
cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh
Important: Keep in mind that the "new" syntax adds a few more datastores, which would cause the graphs to disappear for these services. You can add the "extra" datastores by following the steps, described in the KB article below:
https://support.nagios.com/kb/article/n ... g-149.html

If you don't care of the old perfdata graphs for these particular services, you could just go to "/usr/local/nagios/share/perfdata/<hostname>", and delete the RRD and XML files for these services. They will be recreated and the graphs should reappear in 15-20 minutes.

Again, make sure that you perform a backup, prior to running the above commands (just in case something goes wrong)!

Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked