CHips L MINI SHELL

CHips L pro

Current Path : /opt/zabbix_scripts/
Upload File :
Current File : //opt/zabbix_scripts/check_patchman_status

#!/bin/bash
#########################################################################
#                                                                       #
# Plugin name:  check_patchman_status                                   #
# Description:  Plugin to check if the patchman service is running.     #
# Author:       William Overko                                          #
# Version:      20171218                                                #
#                                                                       #
#########################################################################


declare patchmanStatusOutput=`/etc/init.d/patchman status`
declare patchmanLogLicenseErr=`tail -n 1 /var/log/patchman/patchman.log | grep 'ERROR: Registration key required but not present' | wc -l`

echo ${patchmanLogLicenseErr}

if [[ "$patchmanStatusOutput" == "patchmand"*"is running..." ]]
then
    echo -e "OK: Patchman Is Up."
    exit 0
elif [ "$patchmanStatusOutput" == "patchmand dead but pid file exists" ] || [ "$patchmanStatusOutput" == "patchmand is stopped" ]
then
    echo -e "CRITICAL: Patchman Is Down."
    exit 2
fi

Copyright 2K16 - 2K18 Indonesian Hacker Rulez