Ad Widget

Collapse

how to get host SNMP parameters to external checks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leonardogyn
    Junior Member
    • Nov 2022
    • 7

    #1

    how to get host SNMP parameters to external checks

    Hello Guys ... i'm actually monitoring some devices that, from my Zabbix Server point of view, have all the same IP address. Each host points to the "other side" firewall IP address and an specific SNMP port, that will be forwarded to the real internal IP of that device. It's working fine, pretty simple setup, hosts are created with SNMP interface, IP, port and community.

    Now i'm trying to get some external checks to run against these hosts. I understood how to create a script at "/usr/lib/zabbix/externalscripts", how to call it from the Key field, for example:

    myscript.sh["{HOST.CONN}"]

    What I'm really struggling to acchieve is, at the item on the Template (on the Template I don't know IP address, SNMP port and community), how to inform the correct parameters for the script. The host IP address can be easily acchieved with HOST.CONN, but I really don't know how to call for the SNMP Community (which might be different from $SNMP_COMMUNITY, but always correctly informed on the host entry) and also SNMP port.

    I'm really not looking to create MACROs on each host with the values, I was really trying to be able to "recover" those vsomehow, but I really couldn't find how to do it.

    Is that, getting SNMP Community and SNMP port, via some macro or variable, possible on the Item creation (on the template)?

    Thanks and hope I made myself clear enough ...
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    There is no built-in macros for such things. https://www.zabbix.com/documentation...ed_by_location
    I don't think you can get away without user macros.

    Comment

    • leonardogyn
      Junior Member
      • Nov 2022
      • 7

      #3
      Originally posted by cyber
      There is no built-in macros for such things. https://www.zabbix.com/documentation...ed_by_location
      I don't think you can get away without user macros.
      I was afraid that would be the answer ... I had already found

      With user macros, I could create the external checks and they are working fine! However, when trying to create a new graph (on the template), the items I created (the external check ones) do not appear to be selected on the graph page creation ... do you know if there's some restriction/limitation on graphing items from external check type? I couldn't even see the items, while creating a new graph, right on the host, outside of the template. Now I really can't find a way on creating a custom graph on those

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        item is an item, does not matter, what type it is. if it has a numeric value, it can be graphed.
        I did not really catch it now, where exactly are you not seeing those items?

        Comment

        • leonardogyn
          Junior Member
          • Nov 2022
          • 7

          #5
          Originally posted by cyber
          item is an item, does not matter, what type it is. if it has a numeric value, it can be graphed.
          I did not really catch it now, where exactly are you not seeing those items?
          Thanks, you got it! It was created with type text. As soon as I changed it to number, I'm not able to select it while creating the graphs

          Thanks very much for your attention

          Comment

          Working...