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 ..."
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[category:Nagios]]


== ClamAv Process status In Nagios ==
== 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  
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
You can simply make your own script, like below


   #!/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.

Latest revision as of 07:47, 24 October 2013


ClamAv Process status In Nagios[edit]

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.