diff --git a/README.md b/README.md index c51f473..123bf43 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,38 @@ -Nagios plugin to check Git Repository status -============================================ +# Nagios plugin to check Git Repository status -Usage ------ +## Installation ``` - Usage : check_git_config -g [directory] [-c|-r remote] [-d] - -g [directory] Specify Git root directory (default : /srv/common) - -c Check Git remote state - -r [remote] Specify Git remote to check (default : origin) - -d Enable debug mode +apt-get install git +git clone https://gitea.zionetrix.net/bn8/check_git_config.git /usr/local/src/check_git_config +mkdir -p /usr/local/lib/nagios/plugins +ln -s /usr/local/src/check_git_config/check_git_config /usr/local/lib/nagios/plugins/ + +# To add check on /var/www/website status (owned by www-data) +echo "nagios ALL= (www-data) NOPASSWD: /usr/local/lib/nagios/plugins/check_git_config -g /var/www/website" > /etc/sudoers.d/nagios-git-website +chmod 0400 /etc/sudoers.d/nagios-git-website +echo "command[check_git_website]=sudo -u www-data /usr/local/lib/nagios/plugins/check_git_config -g /var/www/website" > /etc/nagios/nrpe.d/git-website.cfg +service nagios-nrpe-server reload ``` -Copyright ---------- + +## Usage + +``` +Usage : check_git_config -g [directory] [-c|-r remote] [-d] + -g [directory] Specify Git root directory (default : /srv/common) + -c Check Git remote state + -r [remote] Specify Git remote to check (default : origin) + -H Hide detected changes + -F Show full diff in case of changes detected (default: short) + -d Enable debug mode +``` + +## Copyright Copyright (c) 2018 Benjamin Renard -License -------- +## License This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2