Comments (7)
What do you get if you execute it without sudo?
from check-barman.
-sh-4.1$ /usr/lib64/nagios/plugins/check-barman/check-barman.rb -a pg -h /opt/data/MSA/barman -s KBILL-SAP
/usr/local/rvm/gems/ruby-2.1.0/gems/mixlib-shellout-1.3.0/lib/mixlib/shellout.rb:253:in invalid!': Expected process to exit with [0], but received '1' (Mixlib::ShellOut::ShellCommandFailed) ---- Begin output of /usr/bin/barman show-server KBILL-SAP ---- STDOUT: STDERR: ERROR: please run barman as 'barman' user ---- End output of /usr/bin/barman show-server KBILL-SAP ---- Ran /usr/bin/barman show-server KBILL-SAP returned 1 from /usr/local/rvm/gems/ruby-2.1.0/gems/mixlib-shellout-1.3.0/lib/mixlib/shellout.rb:239:in
error!'
from /usr/local/rvm/gems/ruby-2.1.0/gems/rbarman-0.0.13/lib/rbarman/cli_command.rb:345:in run_barman_command' from /usr/local/rvm/gems/ruby-2.1.0/gems/rbarman-0.0.13/lib/rbarman/cli_command.rb:88:in
server'
from /usr/local/rvm/gems/ruby-2.1.0/gems/rbarman-0.0.13/lib/rbarman/server.rb:65:in by_name' from /usr/lib64/nagios/plugins/check-barman/check-barman.rb:56:in
check_pg'
from /usr/lib64/nagios/plugins/check-barman/check-barman.rb:196:in `
-sh-4.1$ vim /usr/lib64/nagios/plugins/check-barman/check-barman.rb
Because, I do not have the right to execute 'barman' with nagios user :
-sh-4.1$ barman status KBILL-SAP
ERROR: please run barman as 'barman' user
I can execute barman with sudo, but it's not compatible with your code :)
-sh-4.1$ sudo /usr/bin/barman status KBILL-SAP
Server KBILL-SAP:
Description: KBILL-SAP PostgreSQL Database
...
from check-barman.
Yes, that's ok, just wanted to know if gem could be found. So it seems to be a problem with sudo.
Could you paste your /etc/sudoers? Which distribution?
from check-barman.
You're using rvm?
from check-barman.
I'm not familiar with rvm, but you should have a look at https://rvm.io/integration/sudo
from check-barman.
Thank you, this link https://rvm.io/integration/sudo helped me.
I added this line on sudoers file :
Defaults env_keep +="rvm_bin_path GEM_HOME IRBRC MY_RUBY_HOME rvm_path rvm_prefix rvm_version GEM_PATH rvmsudo_secure_path RUBY_VERSION rvm_ruby_string rvm_delete_flag PATH"
And commented out this :
Defaults secure_path
Then, I added this line on bash_profile user :
export rvmsudo_secure_path=0
And, with rvmsudo command, I can execute the plugin to check barman :
-sh-4.1$ rvmsudo /usr/lib64/nagios/plugins/check-barman/check-barman.rb -a pg -h /opt/data/MSA/barman -s KBILL-SAP
PG connection ok
Thank you for your help !
from check-barman.
Alright
from check-barman.
Related Issues (14)
- Parse not matching since the 1.3.0 barman version HOT 2
- WAL history file cannot be parsed and is causing an error
- Incompatible with pgbarman 1.6.0? HOT 4
- Undefined method for "check_last_wal_received" HOT 1
- installation
- Error in documentation in regards to warn/crit levels HOT 2
- Why SSH fails? HOT 7
- bad return if you have backup started
- Need help ubuntu server x64 HOT 4
- parse_backup_list fails due to added tablespace. HOT 7
- NRPE: Unable to read output HOT 1
- problem in ubuntu 14.04 HOT 15
- last_wal_received info get failed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from check-barman.