Skip to content
Snippets Groups Projects
Unverified Commit 3ce1bbc3 authored by Pavel Vyskočil's avatar Pavel Vyskočil
Browse files

Added git_pull_check.sh

parent f6363ace
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
## List of Local scripts ## List of Local scripts
Local scripts are located in /usr/lib/check_mk/local/ Local scripts are located in /usr/lib/check_mk/local/
### git_pull_check.sh
* Attributes to be filled:
<pre>
# List of paths to check separated by space
paths=""
</pre>
## List of plugins ## List of plugins
Local scripts are located in /usr/lib/check_mk/plugins/ Local scripts are located in /usr/lib/check_mk/plugins/
\ No newline at end of file
#!/bin/bash
# List of paths to check separated by space
paths=""
for path in $paths
do
if [[ -d $path ]]; then
cd $path
result=$(git fetch --dry-run 2>&1)
if [[ -n $result ]] ; then
status=1
statustxt="WARNING - There are available new commits"
else
status=0
statustxt="OK"
fi
else
status=2
statustxt="CRITICAL - Directory does not exist"
fi
echo "$status git_pull_check_dir=$path - $statustxt"
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment