Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUDO_ASKPASS when using with Icinga instead of Nagios #171

Closed
mchlrv opened this issue Jul 21, 2017 · 4 comments
Closed

SUDO_ASKPASS when using with Icinga instead of Nagios #171

mchlrv opened this issue Jul 21, 2017 · 4 comments
Labels

Comments

@mchlrv
Copy link

mchlrv commented Jul 21, 2017

When using the plugin with Icinga instead of Nagios an error is displayed: "sudo: no askpass program specified, try setting SUDO_ASKPASS" even when running "check_raid.pl -S".

To resolve this edit "/etc/sudoers.d/check_raid" and edit the first config line to "User_Alias CHECK_RAID=icinga".

It would be helpful to be able to specify a username when running "check_raid.pl -S".

Output of check_raid -d:

check_raid 4.0.7
Visit <https://github.com/glensc/nagios-plugin-check_raid#reporting-bugs> how to report bugs

DEBUG EXEC: /proc/mdstat at /opt/monitoring/plugins/check_raid.pl line 482.
DEBUG EXEC: /sbin/dmsetup status --noflush at /opt/monitoring/plugins/check_raid.pl line 482.
DEBUG EXEC: /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL -NoLog at /opt/monitoring/plugins/check_raid.pl line 482.
DEBUG EXEC: /opt/MegaRAID/MegaCli/MegaCli64 -LdInfo -Lall -aALL -NoLog at /opt/monitoring/plugins/check_raid.pl line 482.
UNKNOWN: dm:[No devices to check]; megacli:[Volumes(2): vps-ssd10:Optimal,vps-data10:Optimal; Devices(6): 00,01,02,03,04,05=Online]

Output of each command from check_raid -d

@glensc
Copy link
Owner

glensc commented Aug 8, 2017

so, under icinga, the plugin is ran with icinga user, not nagios user?

also, could you please post contents of your /etc/sudoers.d/check_raid

@glensc glensc added the sudo label Aug 8, 2017
@mchlrv
Copy link
Author

mchlrv commented Aug 9, 2017

That is correct, it is running with icinga user.

Here is the output of /etc/sudoers.d/check_raid

# Lines matching CHECK_RAID added by /opt/monitoring/plugins/check_raid.pl -S on Fri Jul 21 13:37:58 2017
User_Alias CHECK_RAID=icinga
Defaults:CHECK_RAID !requiretty
CHECK_RAID ALL=(root) NOPASSWD: /sbin/dmsetup status --noflush
CHECK_RAID ALL=(root) NOPASSWD: /sbin/dmsetup status
CHECK_RAID ALL=(root) NOPASSWD: /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL -NoLog
CHECK_RAID ALL=(root) NOPASSWD: /opt/MegaRAID/MegaCli/MegaCli64 -LdInfo -Lall -aALL -NoLog
CHECK_RAID ALL=(root) NOPASSWD: /opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL -NoLog

@glensc
Copy link
Owner

glensc commented Aug 10, 2017

i tried to add duplicate line, but that results syntax error:

User_Alias CHECK_RAID=icinga
User_Alias CHECK_RAID=nagios

however, if using comma, does it work for you?

User_Alias CHECK_RAID=icinga, nagios

seems it's valid syntax according to manual:

     # User alias specification
     User_Alias      FULLTIMERS = millert, mikef, dowdy
     User_Alias      PARTTIMERS = bostley, jwfox, crawl
     User_Alias      WEBMASTERS = will, wendy, wim

@mchlrv
Copy link
Author

mchlrv commented Aug 11, 2017

It indeed works perfect, I now have:
User_Alias CHECK_RAID=nagios,icinga

@glensc glensc closed this as completed in e33601d Aug 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants