Check Operating System Version

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.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Check Operating System Version

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Check Operating System Version

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Operating System Version

Post by rlinux57 »

I want to check linux OS version.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Check Operating System Version

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Operating System Version

Post 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 ?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Check Operating System Version

Post 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?
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Operating System Version

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Check Operating System Version

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Operating System Version

Post by rlinux57 »

There's no such script for nrpe i've already searched it in google.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Check Operating System Version

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