Ad Widget

Collapse

Problem with gentemplate.pl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brunocorreia
    Junior Member
    • Jan 2012
    • 9

    #1

    Problem with gentemplate.pl

    I simply can not use the gentemplate.pl .

    I want to create a template for the switches based on the MIB - II since there from where I get the owner and not the manufacturer gives me the information . As I understand the script , if not set the OID starts where the tree owner he would take all the standard MIB infomações .

    In the wiki ( https://www.zabbix.com/wiki/scripts/gentemplate.pl ) the explanation is simple and straightforward , but it does not find the OIDs and only adds an item and nothing icmp monitoring SNMP.

    How am I using ?

    I created a file snmp_switch with content:

    "snmpwalk -v2c -cpublic $IP_ADDRESS"

    And then ran the script with the file created:

    "./gentemplate.pl snmp_switch"

    Face it no longer meets the sysName and asks me to enter it

    "sysName.0 was not found, enter system name:"

    After I enter and confirm it apparently worked beauty:

    "Making items...
    Making graphs...
    Doing interface graphs and triggers"

    Only by checking the output file snmp_switch.xml he just generated the item / trigger icmpping the template.

    Content generated xml template :

    "<?xml version="1.0"?>
    <zabbix_export version="1.0" date="27.04.09" time="14.23">
    <hosts>
    <host name="Template_TESTE">
    <useip>0</useip>
    <dns></dns>
    <ip>0.0.0.0</ip>
    <port>10050</port>
    <status>3</status>
    <groups>
    <group>Templates</group>
    </groups>
    <items>
    <item type="3" key="icmpping" value_type="3">
    <description>ping</description>
    <ipmi_sensor></ipmi_sensor>
    <delay>300</delay>
    <history>7</history>
    <trends>365</trends>
    <status>0</status>
    <units></units>
    <multiplier>0</multiplier>
    <delta>0</delta>
    <formula></formula>
    <lastlogsize>0</lastlogsize>
    <logtimefmt></logtimefmt>
    <delay_flex></delay_flex>
    <params></params>
    <trapper_hosts></trapper_hosts>
    <snmp_community></snmp_community>
    <snmp_oid></snmp_oid>
    <snmp_port>161</snmp_port>
    <snmpv3_securityname></snmpv3_securityname>
    <snmpv3_securitylevel>0</snmpv3_securitylevel>
    <snmpv3_authpassphrase></snmpv3_authpassphrase>
    <snmpv3_privpassphrase></snmpv3_privpassphrase>
    </item>

    </items>
    <triggers>
    <trigger>
    <description>Host unreachable</description>
    <type>0</type>
    <expression>{{HOSTNAME}:icmpping.last(0)}#1</expressio
    n>
    <url></url>
    <status>0</status>
    <priority>1</priority>
    <comments>Host unreachable</comments>
    </trigger>

    </triggers>
    <graphs>

    </graphs>
    </host>
    </hosts>
    </zabbix_export>"

    If someone has already used successfully can give me a help would be grateful.

    Pardon the bad English, google translate.
  • pxsh
    Junior Member
    • Oct 2013
    • 14

    #2
    I've run into the exact same issue so I´m voting +1 for this one to be explained by a SNMP/Zabbix pro.

    Comment

    • steveboyson
      Senior Member
      • Jul 2013
      • 582

      #3
      Simple reason: gentemplate.pl is broken.
      Same thing happens here, I did just check it.

      Comment

      • troffasky
        Senior Member
        • Jul 2008
        • 567

        #4
        This page:



        either needs a health warning that it won't work, or it needs deleting entirely.

        Plenty of warnings about 'Use of uninitialized value ...' when you're using it. Probably the most likely source of the issue(s).

        Comment

        • doug.smith
          Junior Member
          • Mar 2015
          • 1

          #5
          I was able to fix this really easy.

          Under the line:
          my %templates = ('graph' => ' <graph name="GR_NAME" width="900" height="200">

          Add:
          <ymin_type>0</ymin_type>

          Comment

          Working...