Monitoring processes/services by Zabbix by using SNMP

I try to monitor around 60 servers by using Zabbix 2.2 and SNMP. I'm able monitor a lot of values but I'm facing one issue relating to identification status of processes on linux servers.

When the service is up and running I'm able to collect data via SNMP by using OID:

HOST-RESOURCES-MIB::hrSWRunStatus
[
    "index",
    "HOST-RESOURCES-MIB::hrSWRunPath", 
    "name_of_the_service_or_process"
]

Problem is when the service is down. Zabbix does not recognize that and simply shows last value. It is possible to identify the failure in graph, where the line is not even on level 1, or level 0. It's simply missing (because of no data).

Is there any possibility, how to monitor services/processes by using SNMP? Does have anybody any experience with this?

Many thanks ...


Solution 1:

So I little elaborate in this and I decided to develop something by myself. It's script in bash something like this

#!/bin/bash

# Arguments:
# hostname
# service name
# please review community string when you debug any issue with this script

SNMP_COMM_STRING="public"
HOST_NAME=$1
SERVICE_NAME=$2

case $SERVICE_NAME in
  test)
    echo "For testing purposes only ..."
    echo $HOST_NAME
    echo $SERVICE_NAME
    ;;

  *)
    RESULT=$(snmpwalk -v2c -c $SNMP_COMM_STRING $HOST_NAME HOST-RESOURCES-MIB::hrSWRunPath | grep $SERVICE_NAME )

    #if the variable is null then the service is down (or the host is unreachable)
    if [ -z "$RESULT" ]; then
        echo 0
    else
        echo 1
    fi
esac
exit 0
  1. Create the .sh script in proper externalscript directory.
  2. Set up the variables inside the script.
  3. Create item in Zabbix WebUI with following parameters:
  • Name: fill according your needs
  • Type: External check
  • Key: script.sh["{HOST.HOST}","process_name"]
  • Type of information: Numberic (unsigned)
  • Data type: Decimal

Hope this helps. Any other comments are welcome ... Ch.

hi sir ! can you guide me more specifically