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

Unable to update ruby-advisory-db with nagios-nrpe-server #2

Closed
tommarshall opened this issue Nov 2, 2016 · 1 comment
Closed

Unable to update ruby-advisory-db with nagios-nrpe-server #2

tommarshall opened this issue Nov 2, 2016 · 1 comment

Comments

@tommarshall
Copy link
Owner

tommarshall commented Nov 2, 2016

bundler-audit downloads a copy of the Ruby Advisory Database inside the user's home directory. This can cause issues if the user running the script does not have a writable home directory.

Some environments (Ubuntu/Debian confirmed) create a home directory for the nagios user, but do not set it as $HOME when running the nagios-nrpe-server daemon.

$HOME is either /root or undefined. In both cases this will cause bundler-audit to fail to update the advisory DB, which leads to false positives.

@tommarshall
Copy link
Owner Author

tommarshall commented Nov 2, 2016

To fix this you can define $HOME by adding the following to /etc/default/nagios-nrpe-server and restarting the service:

export HOME=/var/lib/nagios

Or by explicitly defining it for the command in the nrpe.cfg:

command[check_bundle_audit]=HOME=/var/lib/nagios /etc/nagios/check_bundle_audit.sh -p /var/www/app

$HOME does not have to be /var/lib/nagios, but this is the home directory for the nagios user on Ubuntu 14.04.

$ sudo -H -u nagios env | grep ^HOME
HOME=/var/lib/nagios

/tmp should work if the nagios user does not have a home directory.

@tommarshall tommarshall changed the title Unable to update ruby-advisory-db on Ubuntu 14.04 with nagios-nrpe-server Unable to update ruby-advisory-db with nagios-nrpe-server Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant