Jump to content

Main Page//Nagios script/ClamAv status: Difference between revisions

From TetraWiki
Amit (talk | contribs)
Created page with " == ClamAv Process status In Nagios == If default Pluging doesn't work properly and if you were not able to find the exact reason behind that or the server is critical to ..."
 
Line 7: Line 7:


   #!/bin/bash
   #!/bin/bash
   STATE_OK=0
   STATE_OK=0
   STATE_WARNING=1
   STATE_WARNING=1
   STATE_CRITICAL=2
   STATE_CRITICAL=2
   STATE_UNKNOWN=3
   STATE_UNKNOWN=3
   STATE_DEPENDENT=4
   STATE_DEPENDENT=4
   CLAMD=`ps -ef | grep clamd| grep -v grep| wc -l`
   CLAMD=`ps -ef | grep clamd| grep -v grep| wc -l`
   case "${CLAMD}" in
   case "${CLAMD}" in
         0)  echo "CLAMD is not running"; exit ${STATE_CRITICAL}
         0)  echo "CLAMD is not running"; exit ${STATE_CRITICAL}
         ;;
         ;;
         1)  echo "CLAMD OK - CLAMD is running"; exit ${STATE_OK}
         1)  echo "CLAMD OK - CLAMD is running"; exit ${STATE_OK}
         ;;
         ;;
         *)  echo "CLAMD is running "; exit ${STATE_OK}
         *)  echo "CLAMD is running "; exit ${STATE_OK}
         ;;
         ;;
   esac
   esac


  The above is done for JbIndia on clamav process I have made may more scripts you can view them in Miraexim Like sldap servises and many more.
The above is done for JbIndia on clamav process I have made may more scripts you can view them in Miraexim Like sldap services and many more.

Revision as of 03:39, 12 September 2013

ClamAv Process status In Nagios

  If default Pluging doesn't work properly and if you were not able to find the exact reason behind that or the server is critical to have any experiment 
  
  You can simply make your own script, like below
 #!/bin/bash
 STATE_OK=0
 STATE_WARNING=1
 STATE_CRITICAL=2
 STATE_UNKNOWN=3
 STATE_DEPENDENT=4
 CLAMD=`ps -ef | grep clamd| grep -v grep| wc -l`
 case "${CLAMD}" in
       0)  echo "CLAMD is not running"; exit ${STATE_CRITICAL}
       ;;
       1)  echo "CLAMD OK - CLAMD is running"; exit ${STATE_OK}
       ;;
        *)  echo "CLAMD is running "; exit ${STATE_OK}
        ;;
 esac

The above is done for JbIndia on clamav process I have made may more scripts you can view them in Miraexim Like sldap services and many more.