Nagios plugin to check Git Repository status
Go to file
2023-04-27 17:02:33 +02:00
.gitignore Initial commit 2013-12-03 16:05:37 +01:00
check_git_config Defaulty show detected changes and add full diff (-F) & hide changes (-H) features 2023-04-27 16:56:51 +02:00 Update file 2023-04-27 17:02:33 +02:00

Nagios plugin to check Git Repository status


apt-get install git
git clone /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


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 (c) 2018 Benjamin Renard


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.