Ad Widget

Collapse

Custom Script on Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Arethusa
    Junior Member
    • Aug 2021
    • 1

    #1

    Custom Script on Zabbix

    Hello,

    I'm new on Zabbix and I want to increase my skills on it ^^

    I usually use Check_mk, and I create custom bash script like that :


    #!/bin/bash
    # /usr/lib/check_mk_agent/local/

    varstatus=$(systemctl status filebeat | grep Active | sed 's/.*(\(.*\)).*/\1/')

    if [ "$varstatus" = running ]

    then

    status="0"
    statustxt="Service is running"

    else

    status="2"
    statustxt="check service status !"

    fi

    echo "$status Check_service_Filebeat - active ($varstatus) -> $statustxt"
    I try to read documentation but I am not sure to understand how I can create custom script like this.

    Thank you.
  • Glencoe
    Zabbix developer
    • Oct 2019
    • 152

    #2
    Even though Zabbix can be used as a script launcher on steroids, there is a support for many popular applications, devices and OSes out of the box.

    In your case, you can use systemd.* items in Agent2: https://www.zabbix.com/documentation.../zabbix_agent2

    Comment

    • Noobz
      Senior Member
      • Jun 2020
      • 105

      #3
      I think you're looking for "actions" - so you create your items, then create triggers which refer to those item values, then your trigger action would be to run a script.

      Comment

      Working...