barman plugin
barman plugin
hi,
whenver i use barman plugin, the NRPE respond with "NRPE: Unable to read output".
i was adding nagios to sudo without password for this script, and when i execute the command in command line (from root), it apears fine:
sudo /usr/lib/nagios/plugins/check-barman.rb -a backups_available -s angus -w 5 -c 6.
same thing happen also when i do it with: barman check --nagios .....
any idea ?
Thanks,
Ami
whenver i use barman plugin, the NRPE respond with "NRPE: Unable to read output".
i was adding nagios to sudo without password for this script, and when i execute the command in command line (from root), it apears fine:
sudo /usr/lib/nagios/plugins/check-barman.rb -a backups_available -s angus -w 5 -c 6.
same thing happen also when i do it with: barman check --nagios .....
any idea ?
Thanks,
Ami
Re: barman plugin
What happens if you execute it as the nagios user (no sudo)?
Also - what are the permissions on the file? ls -l check-barman.rb
Also - what are the permissions on the file? ls -l check-barman.rb
Former Nagios Employee
Re: barman plugin
actually i moved to work directly on barman (barman check --nagios angus) and still same thing happening, also without sudo (when executing it directly with sudo account, its working fine)
sudo -U nagios -l
Matching Defaults entries for nagios on localhost:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User nagios may run the following commands on localhost:
(root) NOPASSWD: /usr/lib/nagios/plugins/check-barman.rb, /usr/bin/barman
(ALL : ALL) ALL
-rwxr-xr-x 1 root root 851 Nov 16 11:51 /usr/bin/barman*
sudo -U nagios -l
Matching Defaults entries for nagios on localhost:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User nagios may run the following commands on localhost:
(root) NOPASSWD: /usr/lib/nagios/plugins/check-barman.rb, /usr/bin/barman
(ALL : ALL) ALL
-rwxr-xr-x 1 root root 851 Nov 16 11:51 /usr/bin/barman*
Re: barman plugin
Can you post how the command is setup in the nrpe,cfg file on the remote sysrem and how you are running the check on the Nagios system?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: barman plugin
Does adding the line below to sudors help?
Code: Select all
nagios ALL=NOPASSWD: /usr/lib/nagios/plugins/check-barman.rb *Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: barman plugin
i tryed both options:
command[check_barman]=sudo /usr/bin/barman check --nagios angus
and
command[check_barman]=sudo /usr/lib/nagios/plugins/check-barman.rb -a backups_available -s angus -w 5 -c 6
(and also without the sudo).
i also tried the advise of adding * to sudoers file (nagios ALL=NOPASSWD:/usr/bin/barman * ), and same result
command[check_barman]=sudo /usr/bin/barman check --nagios angus
and
command[check_barman]=sudo /usr/lib/nagios/plugins/check-barman.rb -a backups_available -s angus -w 5 -c 6
(and also without the sudo).
i also tried the advise of adding * to sudoers file (nagios ALL=NOPASSWD:/usr/bin/barman * ), and same result
Re: barman plugin
On your remote system that the check is installed, can you run the following and post the output here?
Thanks
Code: Select all
/usr/lib/nagios/plugins/check-barman.rb -a backups_available -s angus -w 5 -c 6
su nagios
/usr/lib/nagios/plugins/check-barman.rb -a backups_available -s angus -w 5 -c 6Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: barman plugin
sorry for late response: when i logged in as root i get the following:
/usr/lib/nagios/plugins/check-barman.rb -a backups_available -s angus -w 5 -c 6
1 backups available
su -l nagios -c '/usr/lib/nagios/plugins/check-barman.rb -a backups_available -s angus -w 5 -c 6'
no output
/usr/lib/nagios/plugins/check-barman.rb -a backups_available -s angus -w 5 -c 6
1 backups available
su -l nagios -c '/usr/lib/nagios/plugins/check-barman.rb -a backups_available -s angus -w 5 -c 6'
no output
Re: barman plugin
found the problem...
nagios ALL=(root) NOPASSWD:/usr/bin/barman need to apear after the definitions of the groups. as described in: http://askubuntu.com/questions/504652/a ... oesnt-work
thanks alot for those who were trying to assist!!!
nagios ALL=(root) NOPASSWD:/usr/bin/barman need to apear after the definitions of the groups. as described in: http://askubuntu.com/questions/504652/a ... oesnt-work
thanks alot for those who were trying to assist!!!
Re: barman plugin
I'm glad you got it! Are we all right to close this topic?
Former Nagios Employee.
me.
me.