Page 1 of 2

Check Operating System Version

Posted: Wed Jan 21, 2015 1:07 am
by rlinux57
Getting problem while run command on nagios server:
/usr/lib64/nagios/plugins/check_nrpe -H HOSTNAME -t 30 -c Check_OS_Version -a show-all 'detail-syntax=${kernel_name} Version ${kernel_release}

Here's is the output message:
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

Re: Check Operating System Version

Posted: Wed Jan 21, 2015 1:13 am
by Box293
What version of NSClient++ are you using and what OS is it running on?

Can you please post the nsc.ini or nsclient.ini file here.

Re: Check Operating System Version

Posted: Wed Jan 21, 2015 1:14 am
by rlinux57
I want to check linux OS version.

Re: Check Operating System Version

Posted: Wed Jan 21, 2015 3:21 am
by Box293
rlinux57 wrote:usr/lib64/nagios/plugins/check_nrpe -H HOSTNAME -t 30 -c Check_OS_Version -a show-all 'detail-syntax=${kernel_name} Version ${kernel_release}
You are missing the closing ' at the end of this command

Code: Select all

usr/lib64/nagios/plugins/check_nrpe -H HOSTNAME -t 30 -c Check_OS_Version -a show-all 'detail-syntax=${kernel_name} Version ${kernel_release}'
I've tested this with Linux NSClient++ 0.4.3.77.

Have you enabled insecure settings (this is new in 0.4.3)?

Code: Select all

nscp settings --path /settings/NRPE/server --key insecure --set true
Also, if you want to debug the problem I think you need to:

Code: Select all

nscp settings --path /settings/log --key level --set debug
Restart the NSClient++ service on the linux server

AND add debug to the end of your command

Code: Select all

usr/lib64/nagios/plugins/check_nrpe -H HOSTNAME -t 30 -c Check_OS_Version -a show-all 'detail-syntax=${kernel_name} Version ${kernel_release}' debug
What does the NSClient++ log show now?

Also, have you opened the firewall port on your Linux server?

Re: Check Operating System Version

Posted: Wed Jan 21, 2015 10:18 am
by rlinux57
I was missing closing ' on this post only.
I'm using nrpe. I've nagios monitoring system on linux server.
Is it any changes required in nrpe.cfg at host end ?

Re: Check Operating System Version

Posted: Wed Jan 21, 2015 3:54 pm
by slansing
Yeah I think there was a bit of confusion as to what you were using initially. Can you attach your plugin here as well please? Or provide a link?

Re: Check Operating System Version

Posted: Wed Jan 21, 2015 10:27 pm
by rlinux57
Check this link: http://sites.box293.com/nagios/guides/c ... ing-system

I want to implement for linux servers added in my NMS.
I want to do this through nrpe not nsc.

Re: Check Operating System Version

Posted: Thu Jan 22, 2015 12:49 am
by Box293
Hey thats my page :)

The Check_OS_Version check is ONLY available on the Linux version of NSClient++ 0.4.3 onwards. It is built into NSClient++ for Linux.

Here's some install instructions:
http://sites.box293.com/nagios/guides/n ... unix-linux

If you want to do it using NRPE you'll need to find a script that does it.

Re: Check Operating System Version

Posted: Thu Jan 22, 2015 8:34 am
by rlinux57
There's no such script for nrpe i've already searched it in google.

Re: Check Operating System Version

Posted: Thu Jan 22, 2015 3:02 pm
by slansing
Why not just make a basic script for this? All you need to do is:

Code: Select all

cat /etc/redhat-release
For Centos/RHEL systems, you can switch it around for what ever distro you are checking. You would of course need to build in exit code handling and some simple standard output following:

https://nagios-plugins.org/doc/guidelines.html

This specific check looks at the kernel version, you could base it off of that:

http://exchange.nagios.org/directory/Pl ... on/details