Ad Widget

Collapse

Templates with parameters (via key names)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pikmaster
    Junior Member
    • Feb 2009
    • 12

    #1

    Templates with parameters (via key names)

    Hi

    The great thing would be to have ability to create templates, with parameters.

    Then, values from keynames could be substituted to the templates.

    Example
    Let's say you have the SNMP OID to monitor:
    .1.3.6.1.4.1.2925.4.5.3.1.5.5.1
    Where last digit (.1) is the sequence number, and last but one (.5) is a port number.
    If I have 4 devices connected to port 5 and two devices connected to port 7, I need to create 6 OIDs with 6 keys:
    .1.3.6.1.4.1.2925.4.5.3.1.5.5.1 key-port5-device1
    .1.3.6.1.4.1.2925.4.5.3.1.5.5.2 key-port5-device2
    .1.3.6.1.4.1.2925.4.5.3.1.5.5.3 key-port5-device3
    .1.3.6.1.4.1.2925.4.5.3.1.5.5.4 key-port5-device4
    .1.3.6.1.4.1.2925.4.5.3.1.5.7.1 key-port7-device1
    .1.3.6.1.4.1.2925.4.5.3.1.5.7.2 key-port7-device2

    Every device needs to have unique key, the configuration varies between hosts (port numbers and number of devices connected is different).

    So, if you could use the key name with parameters:
    key-port[portnumber]-device[devicenumber] and a template, which would substitute the parameters to the OID:
    .1.3.6.1.4.1.2925.4.5.3.1.5.$portnumber.$devicenumber

    or just use the position parameters from the key name:
    .1.3.6.1.4.1.2925.4.5.3.1.5.$1.$2
    where $1==portnumber and $2==devicenumber

    You could then use that template between various devices, just substituting correct parameters when creating the key name, like:
    key-port[9]-device[11]
    key-port[3]-device[2]

    etc.
  • troffasky
    Senior Member
    • Jul 2008
    • 567

    #2
    You're not the first person to come up with a clever idea of what Zabbix templates and SNMP items should do, but at the end of the day what Zabbix *really* needs is a way of walking an SNMP agent and automatically creating the requisite Items to monitor.

    Comment

    • pikmaster
      Junior Member
      • Feb 2009
      • 12

      #3
      Well, I don't say that decent SNMp agent is not needed.
      I think the templates with parameters would allow more generic (and more flexible) way of configuring your agents.
      Thanks

      Comment

      Working...