Monitoring Self-Hosted Gitlab

A local check to monitor the basic health of a local Gitlab install using the TOKEN access provided by Gitlab Firstly you must obtain your monitoring TOKEN from Gitlab. This can be found from this address (You must be an admin on the server): http://gitlab.example.com/admin/health_check Once you have located the TOKEN, create the below local Read more about Monitoring Self-Hosted Gitlab[…]

Monitor for Logged in Windows User

A local check to monitor for a particular logged in user on a Windows Server / Desktop. This is a local check which can be put into the Local Check_MK directory on a Windows Server / Desktop to monitor and ensure that a particular user account is logged into the server. C:\Program Files (x86)\check_mk\local\loggedin-user.bat @echo Read more about Monitor for Logged in Windows User[…]

Monitoring Dropbox Sync on Ubuntu

A local check to monitor the sync status of Dropbox on Ubuntu servers. This is a Work in Progress at the moment as I am unsure on the other possible sync statuses. Firstly you must wget the official dropbox.py script used to control the Dropbox CLI wget -O /scripts/dropbox.py “https://www.dropbox.com/download?dl=packages/dropbox.py” Now make this file executable Read more about Monitoring Dropbox Sync on Ubuntu[…]

Monitoring Pending Windows Updates using Check_MK

A guide on how to set up the monitoring of missing Windows Updates using Check_MK. This guide assumes you are working on a 64 bit Windows Server. I am aware that this is an inbuilt function of check_mk, however I found that the windows_updates.vbs local check included with the Check_MK install frequently timed out and Read more about Monitoring Pending Windows Updates using Check_MK[…]

Monitoring Windows Firewall on Windows Server 2008 +

A Check_MK VBS script used on Windows servers of 2008 or newer to monitor the firewall status (Domain, Private and Public). Note: I did not write this plugin! Just documenting to my site for future use Firstly, download the below file and copy across to your check_mk server https://mathias-kettner.de/check_mk_exchange_file.php?HTML=yes&file=win_fw_cee-1.0.mkp Now install the package: cmk -P Read more about Monitoring Windows Firewall on Windows Server 2008 +[…]

Monitoring Postfix mailq

A quick script written to monitor Postfix mailq using a local check nano /usr/share/check-mk-agent/local/mailqueue #!/bin/bash count=$(mailq | grep “Requests” | awk ‘{ print $5 }’) if [ “$count” -gt “50” ]; then status=1 statustext=”$count mails in Postfix Queue” fi if [ “$count” -gt “150” ]; then status=2 statustext=”$count mails in Postfix Queue” fi if [ “$count” Read more about Monitoring Postfix mailq[…]

Monitor pending security updates CentOS

How to monitor pending security updates on a CentOS server with Check_MK Firstly we will need to install the security update plugin for yum in order to be able to search for only pending security updates on your CentOS server yum -y install yum-plugin-security We will now need to create a local check on your Read more about Monitor pending security updates CentOS[…]

Monitor Rsnapshot Backups

To be run on the client Ubuntu server nano /usr/lib/check_mk_agent/local/rsnapshot_monitor #!/bin/bash result=$(tail -n 1 /var/log/rsnapshot.log) if [[ $result == *”completed successfully”* ]]; then status=0 statustext=”Last Backup has completed successfully” else status=2 statustext=”Last Backup has Failed” fi echo “$status Rsnapshotmonitor varname=2;crit $statustext” We now need to make this file executable chmod +x /usr/lib/check_mk_agent/local/rsnapshot_monitor And re-check the client from Read more about Monitor Rsnapshot Backups[…]

Monitor Fail2Ban Blocked IPs – WIP

How to monitor and alarm on the most recent blocked IPs in fail2ban – Work in progress This guide assumes you have setup and configured fail2ban to be appropriate for your setup, see this guide for more. nano /usr/lib/check_mk_agent/local/fail2banblocked #!/bin/sh blockedip=$(cat /var/log/auth.log | grep -a “more authentication failures” | tail -1 | grep -oE “[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}”) blocktime=$(cat /var/log/auth.log Read more about Monitor Fail2Ban Blocked IPs – WIP[…]