How to install plugin check_linux_stats in Ubuntu

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
kaselin
Posts: 2
Joined: Fri Sep 25, 2020 3:22 am

How to install plugin check_linux_stats in Ubuntu

Post by kaselin »

Hi there,
I am new to nagios, I want to use check_linux_stats(https://exchange.nagios.org/directory/P ... ts/details) to monitor my linux system performance.
So I downloaded check_linux_stats.pl and put it in /usr/lib/nagios/plugins.(I already do
sudo apt-get install nagios-nrpe-server nagios-plugins libsys-statistics-linux-perl
)

And I add something in my nrpe.cfg:
command[check_mem]=/usr/lib/nagios/plugins/check_linux_stats.pl -M -w 100,25 -c 100,50
command[check_cpu]=/usr/lib/nagios/plugins/check_linux_stats.pl -C -w 99 -c 100
after save, I do this command
systemctl restart nagios-nrpe-server
then I go to my nagios server device, add this in my {server}.cfg
define service {
host_name node1
service_description check memory
check_command check_nrpe!check_mem
max_check_attempts 2
check_interval 2
retry_interval 2
check_period 24x7
check_freshness 1
contact_groups admins
notification_interval 2
notification_period 24x7
notifications_enabled 1
register 1
}

define service {
host_name node1
service_description check cpu
check_command check_nrpe!check_cpu
max_check_attempts 2
check_interval 2
retry_interval 2
check_period 24x7
check_freshness 1
contact_groups admins
notification_interval 2
notification_period 24x7
notifications_enabled 1
register 1
}
but my nagios show me unknown status (https://imgur.com/a/1XvXZWQ)

Can anyone help me?
Thanks.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: How to install plugin check_linux_stats in Ubuntu

Post by benjaminsmith »

Hi!

That error can be caused by a number of things. We have kb article on troubleshooting this one.

NRPE - NRPE: Unable To Read Output

Let us know if you're able to resolve it by following the guide. Also, make sure your able to successfully run those command directly from the shell.

Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
kaselin
Posts: 2
Joined: Fri Sep 25, 2020 3:22 am

Re: How to install plugin check_linux_stats in Ubuntu

Post by kaselin »

Hi Benjamin,
thanks for your answering, I followed this guide, found out that I didn't have authority to execute check_linux_stats.pl file.
here is my command:

Code: Select all

ls -l /usr/lib/nagios/plugins
and output is https://imgur.com/a/lGOdHjC

so I do this

Code: Select all

chown root:root check_linux_stats.pl
chmod 775 check_linux_stats.pl
system restart nagios-nrpe-server
then back to my nagios server device

Code: Select all

root@node2:/home/dev# /usr/lib/nagios/plugins/check_nrpe -H 10.250.31.42 -c check_mem
MEMORY OK : Mem used: 16.97%, Swap used: 0% |MemUsed=16.97%;100;100 SwapUsed=0%;25;50 MemCached=81.95% SwapCached=0% Active=17.02%
it works successfully, thanks to you!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: How to install plugin check_linux_stats in Ubuntu

Post by benjaminsmith »

it works successfully, thanks to you!
Awesome! Happy to help.

Thank you for using the Nagios Community Forum!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked