Ad Widget

Collapse

Zabbix run script curl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kkpc
    Junior Member
    • Aug 2020
    • 4

    #1

    Zabbix run script curl

    Hi, I need to run a script that will get the serial number from the device. There is no snmp on it. So I have to do it with curl. I already have a script but I don't know how to add it to a template for in zabbix. Thank you for your help
    Last edited by kkpc; 10-08-2020, 22:17.
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    Item type "external check" and your curl (probably full path to command) should work in the script field. HTTP item might also work. External items are somewhat expensive to run, for a S/N, you can probably set a long update frequency.

    Comment


    • kkpc
      kkpc commented
      Editing a comment
      HTTP item ?
      I have url Request URL: http://x.x.x.x/ISAPI/System/deviceInfo
      Response:
      ives such response in XML format:

      <DeviceInfo xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0">
      <deviceName>1.5.1.1</deviceName>
      <deviceID>566eec0b-6580-11b3-81a1-1868cb48861f</deviceID>
      <deviceDescription>IPCamera</deviceDescription>
      <deviceLocation>hangzhou</deviceLocation>
      <systemContact>Hikvision.China</systemContact>
      <model>DS-2CD2155FWD-IS</model>
      <serialNumber>DS-2CD2155FWD-IS20170417AAWR749464587</serialNumber>
      <macAddress>18:68:cb:48:86:1f</macAddress>
      <firmwareVersion>V5.4.5</firmwareVersion>
      <firmwareReleasedDate>build 170124</firmwareReleasedDate>
      <encoderVersion>V7.3</encoderVersion>
      <encoderReleasedDate>build 170123</encoderReleasedDate>
      <bootVersion>V1.3.4</bootVersion>
      <bootReleasedDate>100316</bootReleasedDate>
      <hardwareVersion>0x0</hardwareVersion>
      <deviceType>IPCamera</deviceType>
      <telecontrolID>88</telecontrolID>
      <supportBeep>false</supportBeep>
      <supportVideoLoss>false</supportVideoLoss>
      </DeviceInfo>
      How do i draw <serialNumber> ?
      Thank you for help.
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #3
    Item preprocessing XML XPath probably, here's a sample from the DB MYSQL template: /resultset/row[field/text()='Threads_cached']/field[@name='Value']/text()

    Comment

    Working...