- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Nagios NRPE + sudo + hpacucli not working
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 02:01 AM
тАО04-14-2009 02:01 AM
Nagios NRPE + sudo + hpacucli not working
http://www.nagiosexchange.org/cgi-bin/p ... 8.html;d=1
Also configured /etc/sudoers:
nagios ALL = NOPASSWD: /usr/sbin/hpacucli
If I "su" to user nagios and run the command check_hparray it is working fine.
However, when I try the same thing from nrpe daemon I notice that hpacucli is returning an error status (not 0) but without any error messages/output.
Note: OS is Red Hat Enterprise Linux 5.2.
I am calling multipath command in the same way using nrpe + sudo and this is working.
SELinux is NOT activated.
Any ideas?
Thanks...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 12:46 PM
тАО04-14-2009 12:46 PM
Re: Nagios NRPE + sudo + hpacucli not working
-s)
check=`sudo -u root $HPACUCLI controller slot=$2 ld all show`
# Add this line
echo $check > /tmp/check_array.out 2>&1
check_raid
;;
Consult the /tmp/check_array.out file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 09:32 PM
тАО04-14-2009 09:32 PM
Re: Nagios NRPE + sudo + hpacucli not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 12:52 AM
тАО04-16-2009 12:52 AM
Re: Nagios NRPE + sudo + hpacucli not working
no suggestions...? Thanks ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 04:47 AM
тАО04-16-2009 04:47 AM
Re: Nagios NRPE + sudo + hpacucli not working
echo "$PROGNAME Error. $checkm"
Because the $check variable is empty. There is something wrong because the tmp file has no output, that means that sudo and hpacucli is not being executed.
What do you get if you run:
sudo -u root /usr/sbin/hpacucli controller slot=$2 ld all show
From the command line? Replace $2 for the correct value as in your nrpe.cfg
Post your nrpe.cfg configuration file also for this section.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 10:11 PM
тАО04-16-2009 10:11 PM
Re: Nagios NRPE + sudo + hpacucli not working
If I "su" to user nagios it works:
-sh-3.2$ sudo -u root /usr/sbin/hpacucli controller slot=0 ld all show
Smart Array E200i in Slot 0
array A
logicaldrive 1 (136.7 GB, RAID 1+0, OK)
nrpe.cfg:
command[check_hparray]=/usr/lib/nagios/plugins/check_hparray -s $ARG1$
To me it appears like a problem calling sudo thru nrpe...I├В┬┤m lost...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2009 05:06 AM
тАО04-17-2009 05:06 AM
Re: Nagios NRPE + sudo + hpacucli not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2009 05:10 AM
тАО04-17-2009 05:10 AM
Re: Nagios NRPE + sudo + hpacucli not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2009 06:10 AM
тАО04-17-2009 06:10 AM
Re: Nagios NRPE + sudo + hpacucli not working
- Set SUID to hpacucli
chmod u+s /usr/sbin/hpacucli
- set root:root as owner
chown root:root /usr/sbin/hpacucli
- Remove others read and execution permissions
chmod o-rw /usr/sbin/hpacucli
- Add nagios to root group
gpasswd -a nagios root
- Try again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2009 07:25 AM
тАО04-24-2009 07:25 AM
Re: Nagios NRPE + sudo + hpacucli not working
nagios ALL = NOPASSWD: /usr/sbin/hpacucli controller slot=0 ld all show
This didn├В┬┤t work:
nagios ALL = NOPASSWD: /usr/sbin/hpacucli
(according to the plugin docs it should be enough but wasn├В┬┤t for some reason)