randomhelpfulstuff
randomhelpfulstuff
Random Helpful Stuff
1 post
This site will be updated with random stuff related to my adventures with computers. You may (or may not) find it helpful.
Don't wanna be here? Send us removal request.
randomhelpfulstuff · 11 years ago
Text
How to allow NRPE daemon to run specific commands as root
Edit sudoers files:
visudo
Under the line "root    ALL=(ALL)       ALL" enter the fowling:
nagios  ALL=(ALL)       NOPASSWD: /command/to/execute/as_root
Defaults:nagios         !requiretty
Note: You can separate multiple commands with a comma
Save and exit the file with the vim command:
:wq 
Update your NRPE command config file to prefix the sudo command:
command[nrpe_check]=/usr/bin/sudo /command/to/execute/as_root
Save and exit and restart the nape service:
service nrpe restart
1 note · View note