check_disk not working
check_disk not working
Hello,
I have a nagios server configured in a centOS machine with version 4.0.8 and I'm trying to a put a new ubuntu server VM to monitor, actually the following services are working fine
But check_disk service is not working, the error message is (No output returned from plugin)
on server 1(nagios client)
I installed nagios and nagios-plugins, if I try to check NRPE I got the following
# check_nrpe -h 127.0.0.1
check_nrpe: command not found
It's not working NRPE? how can I check NRPE is well installed? other services are also working fine
define service {
host_name server1
service_description Current Load
check_command check_nrpe!check_load!5!10
use generic-service,graphed-service
notification_interval 0
}
this service returns a reply from nagios server so nrpe should be ok?
on server 2(nagios server)
I set up the *.cfg file with the following options
define service {
host_name server1
service_description Check disk
check_command check_nrpe!check_disk -w 10% -c 5%
use generic-service
notification_interval 0
}
Please can anyone help me to check sda5 free space
Thank you very much!!!
Best regards
I have a nagios server configured in a centOS machine with version 4.0.8 and I'm trying to a put a new ubuntu server VM to monitor, actually the following services are working fine
But check_disk service is not working, the error message is (No output returned from plugin)
on server 1(nagios client)
I installed nagios and nagios-plugins, if I try to check NRPE I got the following
# check_nrpe -h 127.0.0.1
check_nrpe: command not found
It's not working NRPE? how can I check NRPE is well installed? other services are also working fine
define service {
host_name server1
service_description Current Load
check_command check_nrpe!check_load!5!10
use generic-service,graphed-service
notification_interval 0
}
this service returns a reply from nagios server so nrpe should be ok?
on server 2(nagios server)
I set up the *.cfg file with the following options
define service {
host_name server1
service_description Check disk
check_command check_nrpe!check_disk -w 10% -c 5%
use generic-service
notification_interval 0
}
Please can anyone help me to check sda5 free space
Thank you very much!!!
Best regards
Re: check_disk not working
Your screenshots aren't in your post. Also, did you use the full path when you ran check_nrpe from the command line on the host to be monitored? Run this and post the output:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
Re: check_disk not working
Hello,
thank yoy very much for your quick reply, when I did this i get no such file or directory
root@server1:~# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
-bash: /usr/local/nagios/libexec/check_nrpe: No such file or directory
I installed with apt-get install nagios and nagios-plugins packages, on the host cfg file I have the following to check the disk space
define service {
host_name server1
service_description Check disk
check_command check_nrpe!check_disk!10%!5%!
use generic-service
notification_interval 0
}
I also have the following services defined
define service {
host_name server1
service_description Current Users
check_command check_nrpe!check_users
use generic-service
notification_interval 0
}
define service {
host_name server1
service_description SSH
check_command check_ssh
use generic-service
notification_interval 0
}
define service {
host_name server1
service_description Check disk
check_command check_nrpe!check_disk!10%!5%!
use generic-service
notification_interval 0
}
I would like to check free space on SDA5 as you can see on the image below
below you can also see the service working with nrpe, so I suposo nrpe is working
Copiar
Thank you very much for your help
Best regards
thank yoy very much for your quick reply, when I did this i get no such file or directory
root@server1:~# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
-bash: /usr/local/nagios/libexec/check_nrpe: No such file or directory
I installed with apt-get install nagios and nagios-plugins packages, on the host cfg file I have the following to check the disk space
define service {
host_name server1
service_description Check disk
check_command check_nrpe!check_disk!10%!5%!
use generic-service
notification_interval 0
}
I also have the following services defined
define service {
host_name server1
service_description Current Users
check_command check_nrpe!check_users
use generic-service
notification_interval 0
}
define service {
host_name server1
service_description SSH
check_command check_ssh
use generic-service
notification_interval 0
}
define service {
host_name server1
service_description Check disk
check_command check_nrpe!check_disk!10%!5%!
use generic-service
notification_interval 0
}
I would like to check free space on SDA5 as you can see on the image below
below you can also see the service working with nrpe, so I suposo nrpe is working
Copiar
Thank you very much for your help
Best regards
Re: check_disk not working
Hello, please execute the following from the CLI on the NRPE Debian host to be monitored and post the result:
Code: Select all
find / -name nrpe
find / -name nrpe.cfg
Re: check_disk not working
Hello,bolson wrote:Hello, please execute the following from the CLI on the NRPE Debian host to be monitored and post the result:
Code: Select all
find / -name nrpe find / -name nrpe.cfg
here the result of the following command
root@server1:~# find / -name nrpe
/usr/sbin/nrpe
root@server1:~# find / -name nrpe.cfg
/etc/nagios/nrpe.cfg
I also put the command lines from the \etc\nagios\nrpe.cfg
command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10%
and here the server1.cfg with the services to be check
define service {
host_name server1
service_description Check disk
check_command check_nrpe!check_disk!10%!5%!
use generic-service
notification_interval 0
}
Thanks again for your help!!
Have a nice weekend
Best regards
Re: check_disk not working
Is could be a permission problem on the remote server as the nrpe agent is running as either the nrpe user or the nagios user.
If you post the full nrpe.cfg file, we would know for sure.
To change to the nrpe user you would run this
If the agent is using the nagios account, you wouls run this.
To test the plugin as the user, run this
If this works, change the check_disk command in the nrpe.cfg file from
to
Restart the nrpe agent and then when you run the check from the Nagios server, it will test the partition you want.
If you post the full nrpe.cfg file, we would know for sure.
To change to the nrpe user you would run this
Code: Select all
su nrpe
Code: Select all
su nagios
The -p / will check the root partition./usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
If this works, change the check_disk command in the nrpe.cfg file from
Code: Select all
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10%
Code: Select all
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda5
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_disk not working
Hello,tgriep wrote:Is could be a permission problem on the remote server as the nrpe agent is running as either the nrpe user or the nagios user.
If you post the full nrpe.cfg file, we would know for sure.
To change to the nrpe user you would run this
If the agent is using the nagios account, you wouls run this.Code: Select all
su nrpe
To test the plugin as the user, run thisCode: Select all
su nagios
The -p / will check the root partition./usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
If this works, change the check_disk command in the nrpe.cfg file fromtoCode: Select all
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10%
Restart the nrpe agent and then when you run the check from the Nagios server, it will test the partition you want.Code: Select all
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda5
here you can find the nrpe.cfg on the remote server
https://www.dropbox.com/s/0jnp3e89vjm6o87/nrpe.cfg?dl=0
I also tried
root@server1:~# /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
DISK OK - free space: / 24186 MB (89% inode=88%);| /=2954MB;22892;25754;0;28616
so from the remote server I suposed that everything is ok, but on nagios I got the following information on the webui:
This is what I have on nagios server:
server1.cfg
define service {
host_name server1
service_description Check disk
check_command check_nrpe!check_disk!10%5%
use generic-service
notification_interval 0
What should I put there?
check_command check_nrpe!check_disk!10%5% -p /dev/sda5
Thanks for your help again!!!
Best regards
Re: check_disk not working
Your nrpe.cfg file is setup to not use arguments so adding then to the Service Checks on the Nagios server will not matter.
We have found that most binary downloads of the nrpe agent does not have arguments enabled, even if you edit the nrpe.cfg file, the binary file is not compiled with it.
So either hard code the command in the nrpe.cfg file like my previous post or down load the nrpe agent source, compile and configure it to allow arguments.
See this KB article for that.
https://support.nagios.com/kb/article/n ... ource.html
We have found that most binary downloads of the nrpe agent does not have arguments enabled, even if you edit the nrpe.cfg file, the binary file is not compiled with it.
So either hard code the command in the nrpe.cfg file like my previous post or down load the nrpe agent source, compile and configure it to allow arguments.
See this KB article for that.
https://support.nagios.com/kb/article/n ... ource.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_disk not working
Hello,tgriep wrote:Your nrpe.cfg file is setup to not use arguments so adding then to the Service Checks on the Nagios server will not matter.
We have found that most binary downloads of the nrpe agent does not have arguments enabled, even if you edit the nrpe.cfg file, the binary file is not compiled with it.
So either hard code the command in the nrpe.cfg file like my previous post or down load the nrpe agent source, compile and configure it to allow arguments.
See this KB article for that.
https://support.nagios.com/kb/article/n ... ource.html
I done everything on the kb that you requested, now I put the following command
root@server1:~# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p / DISK OK - free space: / 23938 MB (88.20% inode=88%);| /=3202MB;22892;25754;0;28616
Now which is the valid nrpe.cfg file? this?
/usr/local/nagios/etc/nrpe.cfg
On this I have the following commands:
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -r -w .15,.10,.05 -c .30,.25,.20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda5
I added the last one, now what should I put on the server1.cfg? what I have is the following
define service {
host_name server1
service_description Check disk
check_command check_nrpe!check_disk!10%5% -p /dev/sda5
use generic-service
notification_interval 0
}
Thanks again
Best regards!!!
Re: check_disk not working
The valid nrpe config file is this file /usr/local/nagios/etc/nrpe.cfg .
If you want to use arguments in your commands, you have to edit the commands so they will use the arguments that the Nagios server will pass to the NRPE Agent.
To do that, edit /usr/local/nagios/etc/nrpe.cfg file on the remote server and change the command from
to
Save the file and restart the nrpe agent.
Without knowing exactly how you defined the check_nrpe command on the Nagios Server, you would have to change your command from
to
Save the file and restart nagios and see if the check returns the correct information for the /dev/sda5 partition.
If you want to use arguments in your commands, you have to edit the commands so they will use the arguments that the Nagios server will pass to the NRPE Agent.
To do that, edit /usr/local/nagios/etc/nrpe.cfg file on the remote server and change the command from
Code: Select all
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda5
Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
Without knowing exactly how you defined the check_nrpe command on the Nagios Server, you would have to change your command from
Code: Select all
check_command check_nrpe!check_disk!10%5% -p /dev/sda5
Code: Select all
check_command check_nrpe!check_disk!10% 5% /dev/sda5
Be sure to check out our Knowledgebase for helpful articles and solutions!