Page 1 of 1

insufficient privileges

Posted: Wed Dec 17, 2014 5:42 am
by WillemDH
Hello,

Seems like our Nagios XI server has insufficient privileges to check status of httpd service.

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_init_service httpd
OUTPUT: httpd status unknown due to insufficient privileges.
Other local services, like crond and sshd can be checked.

Grtz

Willem

Re: insufficient privileges

Posted: Wed Dec 17, 2014 12:45 pm
by lmiltchev
Add the following line to sudoers:

Code: Select all

nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_init_service httpd
or

Code: Select all

nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_init_service *
Modify your command, so it is going to look something like this:

Code: Select all

define command {
       command_name                  		check_init_service
       command_line                  		sudo $USER1$/check_init_service $ARG1$
}
and your service:

Code: Select all

define service {
	host_name			localhost
	service_description		apache
	use				xiwizard_generic_service
	check_command			check_init_service!httpd!
	register			1
	}
Testing from the CCM will still fail as it is run as apache user, but the check *should* work. Hope this helps.

Re: insufficient privileges

Posted: Tue Dec 23, 2014 5:57 am
by WillemDH
Ludmill,

Seems this solved my issue. Thanks Ludmill!! Thread can be closed.

Grtz

Willem