Ad Widget

Collapse

Any way to Macro an SNMP OID based on Profile Values?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Clubbavich
    Junior Member
    • Oct 2008
    • 5

    #1

    Any way to Macro an SNMP OID based on Profile Values?

    Hi, I'm trying to set up a monitoring solution for my company, and our situation is a bit atypical. We have a great deal of RF equipment, that communicates directly with a centralized Network Management Server. This server stores information about the equipment it manages, and allows us to poll that information via SNMP. Now, each device has a unique identifier that acts as the key for each table of information in the SNMP OID.

    For example, the OID I need to get to could be .1.3.6.1.4.1.x.1.1.1.1.1.(Unique Identifier)
    Then, I also might need .1.3.6.1.4.1.x.1.1.1.1.2.(Same Unique Identifier) per device, so on and so forth. I have about 10 OID's to poll for, for about 1000 devices.... I am able to poll for that information in zabbix just fine on an individual "host" basis. But I need to configure each item individually per "host". Zabbix will be polling the server for each "host" so, in reality, they are sort of pseudo-hosts, and the only thing different between them would be the name, and the unique Identifier in the OID.

    What I would like to do, is make a template that would read, say, the "Tag" field of a host profile, and insert that into the OID. That way, I could simply add hosts, set the Unique Identifier in the Tag field, and apply the template. My end goal is to automate the adding and removing of hosts based on the mysql database on the NMS, and so I'm trying to get as much of this scripted as possible.

    Any help is much appreciated.
  • troffasky
    Senior Member
    • Jul 2008
    • 567

    #2
    Faced with your situation, I'd use a bit of bash and sed. So create your example host, export it to XML, use sed to replace the unique ID. If you need to do it multiple times, use bash to call sed several times. Once done, import the new XML into Zabbix. Bit of a quick and dirty hack, but it's preferable to creating 10,000 new items through the web interface! If you were feeling clever, you could write a bash script that uses an SQL query [or snmpget] to get the unique ID from the NMS, and spits out the required XML data. If you were feeling lucky, you could use the same script to add the "hosts" directly to Zabbix's MySQL database.

    Comment

    • Clubbavich
      Junior Member
      • Oct 2008
      • 5

      #3
      Thanks for the suggestions, however, new hosts are going to be added and removed all the time, and those steps would be a bit complicated for those who would be maintaining this stuff... Would it really be difficult to implement macro checks for the SNMP OID's?

      Comment

      Working...