{"action":"created","issue":{"url":"https://api.github.com/repos/glensc/nagios-plugin-check_raid/issues/125","labels_url":"https://api.github.com/repos/glensc/nagios-plugin-check_raid/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/glensc/nagios-plugin-check_raid/issues/125/comments","events_url":"https://api.github.com/repos/glensc/nagios-plugin-check_raid/issues/125/events","html_url":"https://github.com/glensc/nagios-plugin-check_raid/issues/125","id":117159195,"number":125,"title":"Plugin not working when invoked remotely.","user":{"login":"sbatchu0108","id":10048340,"avatar_url":"https://avatars.githubusercontent.com/u/10048340?v=3","gravatar_id":"","url":"https://api.github.com/users/sbatchu0108","html_url":"https://github.com/sbatchu0108","followers_url":"https://api.github.com/users/sbatchu0108/followers","following_url":"https://api.github.com/users/sbatchu0108/following{/other_user}","gists_url":"https://api.github.com/users/sbatchu0108/gists{/gist_id}","starred_url":"https://api.github.com/users/sbatchu0108/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbatchu0108/subscriptions","organizations_url":"https://api.github.com/users/sbatchu0108/orgs","repos_url":"https://api.github.com/users/sbatchu0108/repos","events_url":"https://api.github.com/users/sbatchu0108/events{/privacy}","received_events_url":"https://api.github.com/users/sbatchu0108/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/glensc/nagios-plugin-check_raid/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-16T16:09:55Z","updated_at":"2015-11-17T15:03:50Z","closed_at":null,"body":"Plugin doesn't work when invoked from the nagios master, but work when i run locally as nrpe user.\r\nOS: CentOS release 5.11 (Final)\r\nbit:x86_64\r\n\r\nAs nrpe user:\r\n```\r\n[nrpe@linuxtest02]~$ whoami\r\nnrpe\r\n[nrpe@linuxtest02]~$ /usr/lib64/nagios/plugins/contrib/check_raid.pl -d\r\ncheck_raid Version 3.2.4\r\nSee CONTRIBUTING.md how to report bugs with debug data:\r\nhttps://github.com/glensc/nagios-plugin-check_raid/blob/master/CONTRIBUTING.md\r\n\r\nDEBUG EXEC: /proc/mdstat at /usr/lib64/nagios/plugins/contrib/check_raid.pl line 460.\r\nDEBUG EXEC: /usr/bin/sudo -A /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL -NoLog at /usr/lib64/nagios/plugins/contrib/check_raid.pl line 460.\r\nDEBUG EXEC: /usr/bin/sudo -A /opt/MegaRAID/MegaCli/MegaCli64 -LdInfo -Lall -aALL -NoLog at /usr/lib64/nagios/plugins/contrib/check_raid.pl line 460.\r\nOK: megacli:[Volumes(2): DISK0.0:Optimal,WriteCache:DISABLED,DISK1.1:Optimal,WriteCache:DISABLED; Devices(10): 25,27,19,18,22,20,23,29,30,31=Online]\r\n[nrpe@linuxtest02]~$ \r\n```\r\nInvoking locally using check_nrpe plugin:\r\n```\r\n[nrpe@linuxtest02]~$ /usr/lib64/nagios/plugins/check_nrpe -H localhost -c check_raid \r\ncheck_raid Version 3.2.4\r\nSee CONTRIBUTING.md how to report bugs with debug data:\r\nhttps://github.com/glensc/nagios-plugin-check_raid/blob/master/CONTRIBUTING.md\r\n\r\nNo RAID configuration found (tried: lsscsi, metastat, mdstat, megacli, ips, aaccli, afacli, mpt, gdth, dpt_i2o, tw_cli, arcconf, megarc, cmdtool2, cciss, hp_msa, sas2ircu, hpacucli, areca, dmraid)\r\n[nrpe@linuxtest02]~$\r\n```\r\n\r\nInvoking remotely from nagios master:\r\n```\r\n[san@master  nagios]$ /usr/lib64/nagios/plugins/check_nrpe -H linuxtest02 -c check_raid\r\ncheck_raid Version 3.2.4\r\nSee CONTRIBUTING.md how to report bugs with debug data:\r\nhttps://github.com/glensc/nagios-plugin-check_raid/blob/master/CONTRIBUTING.md\r\n\r\nNo RAID configuration found (tried: lsscsi, metastat, mdstat, megacli, ips, aaccli, afacli, mpt, gdth, dpt_i2o, tw_cli, arcconf, megarc, cmdtool2, cciss, hp_msa, sas2ircu, hpacucli, areca, dmraid)\r\n[san@master nagios]$\r\n```\r\n\r\nSudoers File:\r\n```\r\n[root@linuxtest02]/var/log$ cat /etc/sudoers.d/nrpe \r\nnrpe ALL=(ALL) NOPASSWD:/usr/lib64/nagios/plugins/contrib/check_megaraid_sas, /usr/lib64/nagios/plugins/contrib/MegaCli64, /usr/lib64/nagios/plugins/contrib/check_raidbattery.sh, /usr/sbin/smartctl, /usr/lib64/nagios/plugins/contrib/check_bbu_learn.pl, /usr/lib64/nagios/plugins/contrib/check_raid.pl, /usr/lib64/nagios/plugins/contrib/check_md_raid.pl, /usr/lib64/nagios/plugins/contrib/check_custom_smartd.pl, /usr/lib64/nagios/plugins/contrib/check_eth_link.sh, /opt/MegaRAID/MegaCli/MegaCli64\r\nDefaults:nrpe !requiretty\r\n[root@linuxtest02]/var/log$\r\n```\r\n\r\nCommands.cfg:\r\n```\r\ntail -2 /etc/nagios/nrpe.cfg\r\ncommand[check_raid]=/usr/lib64/nagios/plugins/contrib/check_raid.pl -d\r\n#EOF\r\n```"},"comment":{"url":"https://api.github.com/repos/glensc/nagios-plugin-check_raid/issues/comments/157395395","html_url":"https://github.com/glensc/nagios-plugin-check_raid/issues/125#issuecomment-157395395","issue_url":"https://api.github.com/repos/glensc/nagios-plugin-check_raid/issues/125","id":157395395,"user":{"login":"sbatchu0108","id":10048340,"avatar_url":"https://avatars.githubusercontent.com/u/10048340?v=3","gravatar_id":"","url":"https://api.github.com/users/sbatchu0108","html_url":"https://github.com/sbatchu0108","followers_url":"https://api.github.com/users/sbatchu0108/followers","following_url":"https://api.github.com/users/sbatchu0108/following{/other_user}","gists_url":"https://api.github.com/users/sbatchu0108/gists{/gist_id}","starred_url":"https://api.github.com/users/sbatchu0108/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbatchu0108/subscriptions","organizations_url":"https://api.github.com/users/sbatchu0108/orgs","repos_url":"https://api.github.com/users/sbatchu0108/repos","events_url":"https://api.github.com/users/sbatchu0108/events{/privacy}","received_events_url":"https://api.github.com/users/sbatchu0108/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T15:03:50Z","updated_at":"2015-11-17T15:03:50Z","body":"yes, nrpe user can access the files:\r\n```\r\ndrwxr-xr-x 11 root root    4096 Nov  9 19:44 /opt\r\ndrwxr-xr-x  3 root root    4096 Nov  9 19:44 /opt/MegaRAID\r\ndrwxr-xr-x  2 root root    4096 Nov  9 19:44 /opt/MegaRAID/MegaCli\r\n-rwxr-xr-x  1 root root 2720320 Dec 16  2013 /opt/MegaRAID/MegaCli/MegaCli64\r\n```\r\nselinux is disabled\r\n```\r\nSELinux status:                 disabled\r\n```\r\n\r\nas nrpe user, i can run the command but not from the master:\r\n\r\n```\r\n[nrpe@linuxtest02]~$ /usr/lib64/nagios/plugins/contrib/check_raid.pl -d\r\ncheck_raid Version 3.2.4\r\nSee CONTRIBUTING.md how to report bugs with debug data:\r\nhttps://github.com/glensc/nagios-plugin-check_raid/blob/master/CONTRIBUTING.md\r\n\r\nDEBUG EXEC: /proc/mdstat at /usr/lib64/nagios/plugins/contrib/check_raid.pl line 460.\r\nDEBUG EXEC: /usr/bin/sudo -A /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL -NoLog at /usr/lib64/nagios/plugins/contrib/check_raid.pl line 460.\r\nDEBUG EXEC: /usr/bin/sudo -A /opt/MegaRAID/MegaCli/MegaCli64 -LdInfo -Lall -aALL -NoLog at /usr/lib64/nagios/plugins/contrib/check_raid.pl line 460.\r\nOK: megacli:[Volumes(2): DISK0.0:Optimal,WriteCache:DISABLED,DISK1.1:Optimal,WriteCache:DISABLED; Devices(10): 25,27,19,18,22,20,23,29,30,31=Online]\r\n[nrpe@linuxtest02]~$\r\n```\r\n\r\n"}}