Check NRPE for Services

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

Re: Check NRPE for Services

Post by lmiltchev »

If I run this from the Nagios server command line
root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H 10.2.8.12 -t 30 -c check_service -a CheckAll CHECK_NRPE: Invalid packet type received from server.
All gives same error Invalid Packet type received.
The NSClient++ syntax changes from version to version, so you may need to review the NSClient++ documentation to make sure you are using the correct command.

What is the output of the following commands?

Code: Select all

/usr/lib/nagios/plugins/check_nrpe -H 10.2.8.12 -t 30 -c CheckServiceState -a CheckAll
/usr/lib/nagios/plugins/check_nrpe -H 10.2.8.12 -t 30 -c CheckServiceState -a Spooler
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check NRPE for Services

Post by tgriep »

Try removing the following option from the nsclient.ini file and see if that fixes it for you.

Code: Select all

extended response = true
Be sure to check out our Knowledgebase for helpful articles and solutions!
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check NRPE for Services

Post by kwhogster »

root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H 10.2.8.12 -t 30 -c CheckServiceState -a CheckAllCRITICAL: clr_optimization_v4.0.30319_32: stopped, SysmonLog: stopped delayed ()|
root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H 10.2.8.12 -t 30 -c CheckServiceState -a Spooler
OK: All 1 service(s) are ok.|'Spooler'=4;0;4

After removing this from nsclient and restarting NSCP service on the server

I made my define service now match the other servers which are working

Code: Select all

define service {
        host_name                       TGCS002
        service_description             Check All Service
        check_command                   check_nrpe!checkservicestate! -a CheckAll "filter=name not like 'clr_optimization_v4.0.30319'" exclude=SysmonLog
        servicegroups                   AllServices
        check_interval                  1
        use                             generic-service
}
define service {
        host_name                       TGCS003
        service_description             Check All Service
        check_command                   check_nrpe!checkservicestate! -a CheckAll exclude=WLMS
        servicegroups                   AllServices
        check_interval                  1
        use                             generic-service
}

TGCS002 is the problem one

TGCS003 works

On Nagios I now see this
All Service

Notifications for this service have been disabled

UNKNOWN 09-01-2016 19:46:14 5d 10h 58m 51s 3/3 Failed to validate filter see log for details


which log are they talking about?

Is my define service command correct?
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check NRPE for Services

Post by kwhogster »

Update

It is definitely my define service I made this change

Code: Select all

define service {
        host_name                       TGCS002
        service_description             Check All Service
#        check_command                   check_nrpe!checkservicestate! -a CheckAll "filter=name not like 'clr_optimization_v4.0.30319'" exclude=SysmonLog
        check_command                   check_nrpe!checkservicestate! -a CheckAll exclude=SysmonLog
        servicegroups                   AllServices
        check_interval                  1
        use                             generic-service
}



Now it is checking but give service error on






Check All Service

Notifications for this service have been disabled

CRITICAL 09-01-2016 19:53:14 0d 0h 1m 37s 3/3 CRITICAL: clr_optimization_v4.0.30319_32: stopped delayed ()

How do I exclude that ? It is from Net Frame and is set an automatic delay service and is never stated all the time

I can change it to manual but after every restart of the server it reverts back to automatic

Need to filter this out

Thanks
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check NRPE for Services

Post by kwhogster »

Update

Code: Select all

define service {
        host_name                       TGCS002
        service_description             Check All Service
        check_command                   check_nrpe!checkservicestate! -a CheckAll  exclude=SysmonLog  exclude=clr_optimization_v4.0.30319_32
        servicegroups                   AllServices
        check_interval                  1
        use                             generic-service
}
Now working forgot the exclude= need that for each service your excluding


This issue and now be closed

Thanks every one for your help
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check NRPE for Services

Post by rkennedy »

Awesome, glad to see it resolved!

Going to close this one out.
Former Nagios Employee
Locked