Hy guys!
I am trying to receive traps from a Windows machine (XP Home). In order to resolve the problem of the OID of the eventlog (generated from the dimension of the field “item.key_”) I have tried to use the Perl script that I have found on the forum to the link "http://www.zabbix.com/forum/showthread.php?t=3929&highlight=perl+trap".
The log file of zabbix_server process is:
010325:20070110:233408 Got data:<req><host>c25tcHRyYXBz</host><key>c25tcC50cmFwLm1zLmV2ZW50bG9n</key><data>WmFiYml4IFdpbjMyIEFnZW50LjE6IFphYmJpeCBX aW4zMiBBZ2VudCBzdGFydGVkDSwsVW5rbm93bixOT1RFQk9PS1 8yLDQsMCwxOTIuMTY4LjAuMTAzLHB1YmxpYw==</data><lastlogsize>MA==</lastlogsize></req>
010325:20070110:233408 Trapper got [<req><host>c25tcHRyYXBz</host><key>c25tcC50cmFwLm1zLmV2ZW50bG9n</key><data>WmFiYml4IFdpbjMyIEFnZW50LjE6IFphYmJpeCBX aW4zMiBBZ2VudCBzdGFydGVkDSwsVW5rbm93bixOT1RFQk9PS1 8yLDQsMCwxOTIuMTY4LjAuMTAzLHB1YmxpYw==</data><lastlogsize>MA==</lastlogsize></req>]
010325:20070110:233408 XML received [<req><host>c25tcHRyYXBz</host><key>c25tcC50cmFwLm1zLmV2ZW50bG9n</key><data>WmFiYml4IFdpbjMyIEFnZW50LjE6IFphYmJpeCBX aW4zMiBBZ2VudCBzdGFydGVkDSwsVW5rbm93bixOT1RFQk9PS1 8yLDQsMCwxOTIuMTY4LjAuMTAzLHB1YmxpYw==</data><lastlogsize>MA==</lastlogsize></req>]
010325:20070110:233408 In process_data([snmptraps],[snmp.trap.ms.eventlog],[Zabbix Win32 Agent.1: Zabbix Win32 Agent started
,,Unknown,NOTEBOOK_2,4,0,192.168.0.103,public],[0])
010325:20070110:233408 Executing query:select i.itemid,i.key_,h.host,h.port,i.delay,i.descriptio n,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h .useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.ho stid,h.status,i.value_type,h.errors_from,i.snmp_po rt,i.delta,i.prevorgvalue,i.lastclock,i.units,i.mu ltiplier,i.snmpv3_securityname,i.snmpv3_securityle vel,i.snmpv3_authpassphrase,i.snmpv3_privpassphras e,i.formula,h.available,i.status,i.trapper_hosts,i .logtimefmt,i.valuemapid from hosts h, items i where h.status=0 and h.hostid=i.hostid and h.host='snmptraps' and i.key_='snmp.trap.ms.eventlog' and i.status=0 and i.type in (2,7)
010325:20070110:233408 Before checking autoregistration for [snmptraps]
010325:20070110:233408 In autoregister(snmptraps)
010325:20070110:233408 Executing query:select hostid from hosts where host='snmptraps'
010325:20070110:233408 Host [snmptraps] already exists. Do nothing.
010325:20070110:233408 Sending back [NOT OK]
I have changed the HOST and the KEY in the script and I called them "snmptraps"
like I have done in the web gui.
Because of I am not able to make my own script because I don't know a scripting language, is there someone that knows if this script is correct or maybe there is some syntax errors? In alternative is there some other script that can help me to solve the problem of the long OIDs without changing the size of "itmes.key_" variable?
Thanks and sorry for my orrible english.
I am trying to receive traps from a Windows machine (XP Home). In order to resolve the problem of the OID of the eventlog (generated from the dimension of the field “item.key_”) I have tried to use the Perl script that I have found on the forum to the link "http://www.zabbix.com/forum/showthread.php?t=3929&highlight=perl+trap".
The log file of zabbix_server process is:
010325:20070110:233408 Got data:<req><host>c25tcHRyYXBz</host><key>c25tcC50cmFwLm1zLmV2ZW50bG9n</key><data>WmFiYml4IFdpbjMyIEFnZW50LjE6IFphYmJpeCBX aW4zMiBBZ2VudCBzdGFydGVkDSwsVW5rbm93bixOT1RFQk9PS1 8yLDQsMCwxOTIuMTY4LjAuMTAzLHB1YmxpYw==</data><lastlogsize>MA==</lastlogsize></req>
010325:20070110:233408 Trapper got [<req><host>c25tcHRyYXBz</host><key>c25tcC50cmFwLm1zLmV2ZW50bG9n</key><data>WmFiYml4IFdpbjMyIEFnZW50LjE6IFphYmJpeCBX aW4zMiBBZ2VudCBzdGFydGVkDSwsVW5rbm93bixOT1RFQk9PS1 8yLDQsMCwxOTIuMTY4LjAuMTAzLHB1YmxpYw==</data><lastlogsize>MA==</lastlogsize></req>]
010325:20070110:233408 XML received [<req><host>c25tcHRyYXBz</host><key>c25tcC50cmFwLm1zLmV2ZW50bG9n</key><data>WmFiYml4IFdpbjMyIEFnZW50LjE6IFphYmJpeCBX aW4zMiBBZ2VudCBzdGFydGVkDSwsVW5rbm93bixOT1RFQk9PS1 8yLDQsMCwxOTIuMTY4LjAuMTAzLHB1YmxpYw==</data><lastlogsize>MA==</lastlogsize></req>]
010325:20070110:233408 In process_data([snmptraps],[snmp.trap.ms.eventlog],[Zabbix Win32 Agent.1: Zabbix Win32 Agent started
,,Unknown,NOTEBOOK_2,4,0,192.168.0.103,public],[0])
010325:20070110:233408 Executing query:select i.itemid,i.key_,h.host,h.port,i.delay,i.descriptio n,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h .useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.ho stid,h.status,i.value_type,h.errors_from,i.snmp_po rt,i.delta,i.prevorgvalue,i.lastclock,i.units,i.mu ltiplier,i.snmpv3_securityname,i.snmpv3_securityle vel,i.snmpv3_authpassphrase,i.snmpv3_privpassphras e,i.formula,h.available,i.status,i.trapper_hosts,i .logtimefmt,i.valuemapid from hosts h, items i where h.status=0 and h.hostid=i.hostid and h.host='snmptraps' and i.key_='snmp.trap.ms.eventlog' and i.status=0 and i.type in (2,7)
010325:20070110:233408 Before checking autoregistration for [snmptraps]
010325:20070110:233408 In autoregister(snmptraps)
010325:20070110:233408 Executing query:select hostid from hosts where host='snmptraps'
010325:20070110:233408 Host [snmptraps] already exists. Do nothing.
010325:20070110:233408 Sending back [NOT OK]
I have changed the HOST and the KEY in the script and I called them "snmptraps"
like I have done in the web gui.
Because of I am not able to make my own script because I don't know a scripting language, is there someone that knows if this script is correct or maybe there is some syntax errors? In alternative is there some other script that can help me to solve the problem of the long OIDs without changing the size of "itmes.key_" variable?
Thanks and sorry for my orrible english.