How to configure Nagios to run plugin with sudo
Re: How to configure Nagios to run plugin with sudo
Looking over the previous posts, your command looks odd. You run a perl script, then sudo, and finally a shell script - all in the same command. Does this combination work on the cli?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: How to configure Nagios to run plugin with sudo
Hi,
It's indeed working from the CLI, the first perl script is used to display the error message from nagios, without it I will not get any error message.
Refer to my attached screenshot.
Thanks,
Rudy
It's indeed working from the CLI, the first perl script is used to display the error message from nagios, without it I will not get any error message.
Refer to my attached screenshot.
Thanks,
Rudy
You do not have the required permissions to view the files attached to this post.
Re: How to configure Nagios to run plugin with sudo
This has to be a sudoers issue. The only real difference between my working sudo checks and yours I see is the following line:
Which is essentially disabled in my sudoers file.
Code: Select all
Defaults !requirettyFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: How to configure Nagios to run plugin with sudo
Hi abrist,
May I know how to disable it? Do I just need to remove it ? Or add some # to comment it out?
Thanks,
Rudy
May I know how to disable it? Do I just need to remove it ? Or add some # to comment it out?
Thanks,
Rudy
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: How to configure Nagios to run plugin with sudo
You would need to edit the sudoers file and edit that line to the following:
Code: Select all
##Defaults requiretty
Re: How to configure Nagios to run plugin with sudo
Hi,
I have changed the line as you suggested, and also add the following:
And now my service test and check works.
Thanks for all your suggestion.
I have changed the line as you suggested, and also add the following:
Code: Select all
nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/
apache ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/
Thanks for all your suggestion.