using of check_linux_stat.pl Command

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.
Locked
gsivaa
Posts: 7
Joined: Wed Sep 21, 2016 1:00 am

using of check_linux_stat.pl Command

Post by gsivaa »

Hi Folks,

I am new to nagios and I am interested in using the script check_linux_stat.pl...

Could you please some one explain me on how to implement this in the Servers..
Like commands.cfg , nrpe.cfg and services.cfg files? what are the entires i need to hardcore in these files ?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: using of check_linux_stat.pl Command

Post by rkennedy »

I believe we're already working through a similar issue here for you - https://support.nagios.com/forum/viewto ... 81#p196981

Here's a short explaination though.

- Upload check_linux_stat.pl to the client machine, usually /usr/local/nagios/libexec/ (ensure permissions are proper for nagios user)
- Modify /usr/local/nagios/etc/nrpe.cfg and define a command for check_linux_stat.pl, something like - command[check_linux_stat]=/usr/local/nagios/libexec/check_linux_stat.pl
- Restart NRPE, or XINETD on the client machine, depending on how you have it running. The client machine should be good to go now.
- Now, make sure you have check_nrpe defined on the Nagios machine in your commands file -

Code: Select all

define command {
       command_name                             check_nrpe
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
- Define your service like so (only showing the check_command part here)

Code: Select all

define service {
...
check_command check_nrpe!check_linux_stat
...
}
Now restart the nagios service and you should be seeing the output as if you were executing /usr/local/nagios/libexec/check_linux_stat.pl on the client machine.
Former Nagios Employee
gsivaa
Posts: 7
Joined: Wed Sep 21, 2016 1:00 am

Re: using of check_linux_stat.pl Command

Post by gsivaa »

Hi,

How can i monitor the different services using this same command..

When i just follow your instruction as per the previous reply, i am getting the error message in the browser as ,
(NO output returned from Plugin)
gsivaa
Posts: 7
Joined: Wed Sep 21, 2016 1:00 am

Re: using of check_linux_stat.pl Command

Post by gsivaa »

Problem has been fixed..
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: using of check_linux_stat.pl Command

Post by rkennedy »

Awesome, nice catch.

Going to mark this as resolved and close it out!
Former Nagios Employee
Locked