Ad Widget

Collapse

help with action remote command execute on zabbix *SERVER*

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fisherwei
    Junior Member
    • Sep 2018
    • 2

    #1

    help with action remote command execute on zabbix *SERVER*

    hello,

    Operation type = remote command
    Target list = current host
    Type = custom script
    Execute on Zabbix server

    I want to access an URL for restart service by zabbix server side.
    Like is: curl http://userass@<host_ip>/restart.cgi

    But how to get <host_ip> from "current host"?


    BTW: host is an embedded device, so no agent.

  • steeladept
    Member
    • Sep 2018
    • 69

    #2
    How do you normally address the device for configuration and whatnot? It is the same. It doesn't NEED to be IP address. Even so, if you insist on it, do a nslookup to find out from the DNS Server, since that is where it gets converted to an IP address anyway.

    Comment

    • ingus.vilnis
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Mar 2014
      • 908

      #3
      Wouldn't Zabbix built in macros help in this case?



      Code:
      curl http://user:pass@{HOST.IP}/restart.cgi
      Of course the IP must be set in Configuration -> Hosts for each particular host in question.

      Comment

      • steeladept
        Member
        • Sep 2018
        • 69

        #4
        If you are looking for it to be generic and not a specific host, this is correct, and I just misunderstood. What I was meaning, written in the same vein as Ingus is {HOST.HOST} should work equally well as {HOST.IP} - assuming DNS is properly setup already.

        Comment

        Working...