Hi,
I read several topic in this forum and search in google about my problem but no find the solution.
I need to run a command 'check_disk' in a folder (filesystem) like 'root' (command sudo) where the limit access "drwx------ postgres postgres" .
(Remote host) I edit de file sudo (visudo)
#NAGIOS
Defaults:nrpe !requiretty
nrpe ALL=(root) NOPASSWD:/usr/lib64/nagios/plugins/check_disk
(Remote Host) I run the command:
/usr/bin/sudo /usr/lib64/nagios/plugins/check_disk -w 80 -c 90 -p /var/lib/pgsql/pg_tblspc ---> It is WORK !!!
In nrpe.cfg
command[check_disk_sdb2_1]=/usr/lib64/nagios/plugins/check_disk -w 80 -c 90 -p /var/lib/pgsql/pg_tblspc
command[check_disk_sdb2_2]==/usr/bin/sudo /usr/lib64/nagios/plugins/check_disk -w 80 -c 90 -p /var/lib/pgsql/pg_tblspc
command[check_disk_sdb1_1]=/usr/lib64/nagios/plugins/check_disk -w 80 -c 90 -p /
command[check_disk_sdb1_2]==/usr/bin/sudo /usr/lib64/nagios/plugins/check_disk -w 80 -c 90 -p /
I run command:
/usr/local/nagios/libexec/check_nrpe -H REMOTE_HOST check_disk_sdb2_1
DISK CRITICAL - /var/lib/pgsql/pg_tblspc is not accessible: Permission denied --> It is OK. It is running like no root
/usr/local/nagios/libexec/check_nrpe -H REMOTE_HOST check_disk_sdb2_2
NRPE: Unable to read output --> NO WORK, WHY?
/usr/local/nagios/libexec/check_nrpe -H REMOTE_HOST -c check_disk_sdb1_1
DISK OK - free space: / 195423 MB (83.60% inode=100%);| /=38333MB;233676;233666;0;233756 ---> It is OK.
/usr/local/nagios/libexec/check_nrpe -H REMOTE_HOST -c check_disk_sdb1
NRPE: Unable to read output --> NO WORK, WHY?
I try to use new my script file, but the result is the same.
I don't know what is happend ???? Why is the message "NRPE: Unable to read output " where i running some command ike sudo ?
The host is a both Centos 7 ( Kernel: Linux 3.10.0-693.17.1.el7.x86_64)
NRPE - Version: 3.2.0
Nagios Core 4.1.1
NRPE: Unable to read output - using sudo
-
- Posts: 3
- Joined: Mon Apr 09, 2018 1:32 am
Re: NRPE: Unable to read output - using sudo
Do you really have '==' in your nrpe.cfg file or is it a typo?
If you have '==' try changing it to a single '='.
If you have '==' try changing it to a single '='.
--
D/\N
D/\N
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
-
- Posts: 3
- Joined: Mon Apr 09, 2018 1:32 am
Re: NRPE: Unable to read output - using sudo
Sorry, I write '==' but in the file rnpe.cfg it is a '='
I rest the service : systemctl restart nrpe.service
But It is no work. When i run a command (Nagios Server) "/usr/local/nagios/libexec/check_nrpe -H vs-sigm-bd-pre -c check_disk_sdb1" the message is: "NRPE: Unable to read output"
I don't know it !!!??
I check that
(remote server) su nagios
(remote server) [nagios] /usr/lib64/nagios/plugins/check_disk -w 80 -c 90 -p /var/lib/pgsql/pg_tblspc --> IT IS WORK
Any idea?
I rest the service : systemctl restart nrpe.service
But It is no work. When i run a command (Nagios Server) "/usr/local/nagios/libexec/check_nrpe -H vs-sigm-bd-pre -c check_disk_sdb1" the message is: "NRPE: Unable to read output"
I don't know it !!!??
I check that
(remote server) su nagios
(remote server) [nagios] /usr/lib64/nagios/plugins/check_disk -w 80 -c 90 -p /var/lib/pgsql/pg_tblspc --> IT IS WORK
Any idea?
-
- Posts: 3
- Joined: Mon Apr 09, 2018 1:32 am
Re: NRPE: Unable to read output - using sudo
Anybody?
please !!!
please !!!
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRPE: Unable to read output - using sudo
in visudo you need something like this (assuming NRPE daemon is running under the user "nrpe")
NOTE this is different that what you previously shared
Code: Select all
Defaults:nrpe !requiretty
nrpe ALL=NOPASSWD: /usr/lib64/nagios/plugins/check_disk