Created
February 26, 2017 04:12
-
-
Save christianchristensen/0b7fa73e1831b2d27554e3fa3f2f97b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<zabbix_export> | |
<version>3.2</version> | |
<date>2017-02-26T04:08:53Z</date> | |
<groups> | |
<group> | |
<name>Templates</name> | |
</group> | |
</groups> | |
<templates> | |
<template> | |
<template>Template App Alarm Decoder</template> | |
<name>Template App Alarm Decoder</name> | |
<description>Alarm Decoder serial output logging analysis | |
| |
http://www.alarmdecoder.com/ | |
| |
$ sudo ./ser2sock -f ser2sock.conf | |
$ nohup ./readtolog.sh 127.0.0.1 10000 & | |
$ cat readtolog.sh | |
#!/bin/bash | |
# http://stackoverflow.com/questions/38246267/bash-how-to-make-telnet-or-nc-work-in-background-until-connection-is-closed | |
ip=$1 | |
port=$2 | |
while [ 1 ] | |
do | |
nc -d $ip $port | while read line ; do echo `date +'%d%m%Y-%H%M%S'`: $line >>console-$ip-$port.txt; done | |
sleep .1 | |
done | |
| |
| |
Example log lines: | |
$ grep "FAULT" console-127.0.0.1-10000.txt | |
25022017-212050: [...--],001,[...],"FAULT 01 DOOR " | |
<groups> | |
<group> | |
<name>Templates</name> | |
</group> | |
</groups> | |
<applications> | |
<application> | |
<name>Alarm Decoder</name> | |
</application> | |
</applications> | |
<items> | |
<item> | |
<name>Zone fault value</name> | |
<type>7</type> | |
<snmp_community/> | |
<multiplier>0</multiplier> | |
<snmp_oid/> | |
<key>log[{$ADLOGPATH},"FAULT ([0-9]+)",,,,\1]</key> | |
<delay>60</delay> | |
<history>90</history> | |
<trends>365</trends> | |
<status>0</status> | |
<value_type>3</value_type> | |
<allowed_hosts/> | |
<units/> | |
<delta>0</delta> | |
<snmpv3_contextname/> | |
<snmpv3_securityname/> | |
<snmpv3_securitylevel>0</snmpv3_securitylevel> | |
<snmpv3_authprotocol>0</snmpv3_authprotocol> | |
<snmpv3_authpassphrase/> | |
<snmpv3_privprotocol>0</snmpv3_privprotocol> | |
<snmpv3_privpassphrase/> | |
<formula>1</formula> | |
<delay_flex/> | |
<params/> | |
<ipmi_sensor/> | |
<data_type>0</data_type> | |
<authtype>0</authtype> | |
<username/> | |
<password/> | |
<publickey/> | |
<privatekey/> | |
<port/> | |
<description/> | |
<inventory_link>0</inventory_link> | |
<applications> | |
<application> | |
<name>Alarm Decoder</name> | |
</application> | |
</applications> | |
<valuemap> | |
<name>Alarm fault map</name> | |
</valuemap> | |
<logtimefmt/> | |
</item> | |
<item> | |
<name>File size of $1</name> | |
<type>7</type> | |
<snmp_community/> | |
<multiplier>0</multiplier> | |
<snmp_oid/> | |
<key>vfs.file.size[{$ADLOGPATH}]</key> | |
<delay>60</delay> | |
<history>7</history> | |
<trends>365</trends> | |
<status>0</status> | |
<value_type>3</value_type> | |
<allowed_hosts/> | |
<units>B</units> | |
<delta>0</delta> | |
<snmpv3_contextname/> | |
<snmpv3_securityname/> | |
<snmpv3_securitylevel>0</snmpv3_securitylevel> | |
<snmpv3_authprotocol>0</snmpv3_authprotocol> | |
<snmpv3_authpassphrase/> | |
<snmpv3_privprotocol>0</snmpv3_privprotocol> | |
<snmpv3_privpassphrase/> | |
<formula>1</formula> | |
<delay_flex/> | |
<params/> | |
<ipmi_sensor/> | |
<data_type>0</data_type> | |
<authtype>0</authtype> | |
<username/> | |
<password/> | |
<publickey/> | |
<privatekey/> | |
<port/> | |
<description/> | |
<inventory_link>0</inventory_link> | |
<applications> | |
<application> | |
<name>Alarm Decoder</name> | |
</application> | |
</applications> | |
<valuemap/> | |
<logtimefmt/> | |
</item> | |
<item> | |
<name>File age of $1</name> | |
<type>7</type> | |
<snmp_community/> | |
<multiplier>0</multiplier> | |
<snmp_oid/> | |
<key>vfs.file.time[{$ADLOGPATH}]</key> | |
<delay>60</delay> | |
<history>7</history> | |
<trends>365</trends> | |
<status>0</status> | |
<value_type>3</value_type> | |
<allowed_hosts/> | |
<units>unixtime</units> | |
<delta>0</delta> | |
<snmpv3_contextname/> | |
<snmpv3_securityname/> | |
<snmpv3_securitylevel>0</snmpv3_securitylevel> | |
<snmpv3_authprotocol>0</snmpv3_authprotocol> | |
<snmpv3_authpassphrase/> | |
<snmpv3_privprotocol>0</snmpv3_privprotocol> | |
<snmpv3_privpassphrase/> | |
<formula>1</formula> | |
<delay_flex/> | |
<params/> | |
<ipmi_sensor/> | |
<data_type>0</data_type> | |
<authtype>0</authtype> | |
<username/> | |
<password/> | |
<publickey/> | |
<privatekey/> | |
<port/> | |
<description/> | |
<inventory_link>0</inventory_link> | |
<applications> | |
<application> | |
<name>Alarm Decoder</name> | |
</application> | |
</applications> | |
<valuemap/> | |
<logtimefmt/> | |
</item> | |
</items> | |
<discovery_rules/> | |
<httptests/> | |
<macros> | |
<macro> | |
<macro>{$ADLOGPATH}</macro> | |
<value>/path/to/ser2sock/console-127.0.0.1-10000.txt</value> | |
</macro> | |
</macros> | |
<templates/> | |
<screens/> | |
</template> | |
</templates> | |
<value_maps> | |
<value_map> | |
<name>Alarm fault map</name> | |
<mappings> | |
<mapping> | |
<value>1</value> | |
<newvalue>Door</newvalue> | |
</mapping> | |
</mappings> | |
</value_map> | |
</value_maps> | |
</zabbix_export> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment