Ad Widget

Collapse

How can add and run a custom script in zabbix server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bab
    Senior Member
    • Aug 2020
    • 176

    #1

    How can add and run a custom script in zabbix server

    I have written a bash script such as follow :

    HTML Code:
    #!/bin/bash
    
    cd /home/oracle ; . db-env; sqlplus / as sysdba << EOF >/dev/null
    @/home/oracle/backupscript/startup.sql
    spool /home/oracle/backupscript/result.txt
    @/home/oracle/backupscript/select.sql
    EOF
    sleep 40
    if [ `grep -i OPEN /home/oracle/backupscript/result.txt` == "OPEN" ]
    then
    sleep 40
    exit 0
    else
    exit 1
    fi

    Actually want if in result.txt file find open show ok , otherwise show critical . now want to know how can use this for my host ?

  • bab
    Senior Member
    • Aug 2020
    • 176

    #2
    Would you please help me ?

    Comment

    • bab
      Senior Member
      • Aug 2020
      • 176

      #3
      Would you help me how can a remote script in zabbix ? I am using zabbix 5

      Comment

      • dotup.de
        Junior Member
        • Aug 2020
        • 3

        #4
        Maybe your searching for remote commands


        Comment

        • bab
          Senior Member
          • Aug 2020
          • 176

          #5
          Actually previously saw that but most of those commands has been deprecated in zabbix 5 and I am using zabbix 5

          Comment

          Working...