Ad Widget

Collapse

Discovery ExternalScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Spikedammage
    Junior Member
    • Dec 2012
    • 4

    #1

    Discovery ExternalScript

    Hi everybody,

    Im using zabbix 2.0.3 on a debian machine.

    I want to monitor interrupts/s per device on several debian server. I searched some mibs which inlcude SNMP OIDs for those values but i found nothing... So i decided to make a script (IRQDiscoveryCheck.sh) which ll connect to distant servers by ssh protocol and execute the commande : cat /proc/interrupts. Then the same script ll store in an array the ID and the name of each IRQ. Finaly the script convert the array in json format to be understable by zabbix.

    The output of IRQDiscoveryCheck.sh :

    {
    "data": [
    {
    "{#IRQNum}": "0",
    "{#IRQName}": "timer"
    },
    {
    "{#IRQNum}": "1",
    "{#IRQName}": "i8042"
    },
    {
    "{#IRQNum}": "6",
    "{#IRQName}": "floppy"
    },
    .....
    {
    "{#IRQNum}": "29",
    "{#IRQName}": "eth1"
    }
    ]
    }

    In zabbix frontend i created a Discovery rule like this :



    Then added a prototype item which call an other external script (IRQPerSec.sh) with a parameter : the IRQNum which is given by the IRQDiscoveryCheck.sh



    My problem is : When zabbix try to create new items, the frontend says :

    "Cannot create item [IRQPerSec.sh[{#IRQNum}]]: item already exists
    Cannot create item [IRQPerSec.sh[{#IRQNum}]]: item already exi"

    I think the problem is that the item prototype cannot resolve the name of the macro {#IRQNum}. I think i did something wrong in frontend configuration but cant find what..

    If anyone can help me with that, could be really nice !!

    Thanks
  • qix
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2006
    • 423

    #2
    Shouldn't macros be UPPERCASE ?

    Edit:
    Yup, documentation says:
    The following characters are allowed in the macro names: A-Z , 0-9 , _ , .
    Last edited by qix; 17-12-2012, 23:56. Reason: Found it in the manual
    With kind regards,

    Raymond

    Comment

    • Spikedammage
      Junior Member
      • Dec 2012
      • 4

      #3
      You right, i just retried with UPPERCASE macro and it works perfectly!

      Thanks a lot for your reply!

      Have a nice day

      Comment

      • qix
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2006
        • 423

        #4
        Great, hth!
        With kind regards,

        Raymond

        Comment

        Working...