barman plugin

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
amicohen1
Posts: 5
Joined: Tue Mar 01, 2016 9:14 am

barman plugin

Post by amicohen1 »

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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: barman plugin

Post by rkennedy »

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
Former Nagios Employee
amicohen1
Posts: 5
Joined: Tue Mar 01, 2016 9:14 am

Re: barman plugin

Post by amicohen1 »

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*
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: barman plugin

Post by tgriep »

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!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: barman plugin

Post by lmiltchev »

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!
amicohen1
Posts: 5
Joined: Tue Mar 01, 2016 9:14 am

Re: barman plugin

Post by amicohen1 »

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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: barman plugin

Post by tgriep »

On your remote system that the check is installed, can you run the following and post the output here?

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 6
Thanks
Be sure to check out our Knowledgebase for helpful articles and solutions!
amicohen1
Posts: 5
Joined: Tue Mar 01, 2016 9:14 am

Re: barman plugin

Post by amicohen1 »

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
amicohen1
Posts: 5
Joined: Tue Mar 01, 2016 9:14 am

Re: barman plugin

Post by amicohen1 »

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!!!
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: barman plugin

Post by hsmith »

I'm glad you got it! Are we all right to close this topic?
Former Nagios Employee.
me.
Locked