📜 ⬆️ ⬇️

Monitoring Linksys SPA8000 via Zabbix



How it all began


Some of our clients have Linksys (Cisco) SPA8000 VoIP gateways. Not bad in their own piece of iron, despite some oddities, for example, NAT nailed on slave ports and strange behavior in some situations. All wanted to impose on them their sweaty little hands and zamonitorit the most can not. But here's the problem: they are extremely poor in monitoring - only the web-interface for visual assessment of the chaos going on there and the external Syslog-server, which is not too much, and there is no more: registration status data. In general, the impregnable gland is as harsh as the Mongol-Tatar yoke. As a result, it was decided to apply a workaround and grab the enemy for ... web-interface. What came out of it - read on.

What do we take?


Since I don’t need someone else’s, and we don’t give up ours, let's not dig all the tons of information that is in the web interface. All you have to do is register line statuses and some general indicators - you need to draw beautiful graphics from something. By analyzing the info page, the following indicators were selected:
')
# Hostname .    - . spa8000.name = SPA8000 #  .    . spa8000.serial = CFH01N704858 #  . spa8000.software = 6.1.12(XU) #  ,   . spa8000.hardware = 1.0.0 # MAC-  .   . spa8000.mac = D0C789784BE4 #   . spa8000.cert = Installed #      . spa8000.customization = Open #   .    NTP, . spa8000.time = 1/12/2003 14:15:42 spa8000.system.uptime = 11 days and 02:15:42 #     ,   # ,   . spa8000.rtp.packets.sent = 3463097 spa8000.rtp.bytes.sent = 646834968 spa8000.rtp.packets.recv = 3435569 spa8000.rtp.bytes.recv = 641524220 spa8000.sip.msg.sent = 76279 spa8000.sip.bytes.sent = 36830167 spa8000.sip.msg.recv = 73969 spa8000.sip.bytes.recv = 30078139 # Autodiscovery . #  . spa8000.line{#LINE}.hook.state = On #   . spa8000.line{#LINE}.reg.state = Registered #     . spa8000.line{#LINE}.reg.time = 1/12/2003 14:08:01 #    . spa8000.line{#LINE}.reg.next = 1321 s #     . spa8000.line{#LINE}.mvi = No #    callback. spa8000.line{#LINE}.callback = No #  ,      . spa8000.line{#LINE}.last.called = 8965 #       . spa8000.line{#LINE}.last.caller = +7911 

Since the trunk lines on the SPA were not tuned, no data was collected on them.

How to take?


All the above data was supposed to be extracted from the web-interface by a direct request by the script and subsequent parsing. Since there is no way to control how often Zabbix will interrogate the web interface (all of a sudden the genius of colleagues decides that polling the interface every five seconds is very fun), and the SPA is known to be slow, it was decided to enter The script is a simple caching system, the requesting interface is no more than once every 30 seconds. The cache itself is a regular CSV file that lies in the / tmp folder and contains data in the following format:

 "info","SPA8000","CFH01N704858","6.1.12(XU)","1.0.0","D0C789784BE4","Installed","Open","1/12/2003 14:15:42","11 days and 02:15:42",3463097,646834968,3435569,641524220,76279,36830167,73969,30078139 "line1","On","Registered","1/12/2003 14:08:01",1321,"No","No","8965","+7911" "line2", . . . 

The first field in each line is the cache line identifier. The first line contains general information, the second and subsequent ones contain information on all the lines in order.

Since this is the first version of the script, it does not support authorization, but it will be easy to add it if necessary. Running the script without parameters results in autodiscovery for lines. If a specific parameter value is required, the script is called in the format zabbix_spa8000.py $ 1 $ 2, where $ 1 is the group of data that is requested, the first value in the cache line, $ 2 is the specific value that needs to be obtained.

zabbix_spa8000.py
 #!/usr/bin/python # Get Cisco SPA status for Zabbix. # codecs ,        . #import codecs import csv import datetime import os.path import re import sys import tempfile import time import urllib #   . url = 'http://<web_interface_addr>/voice/' #    . temp = tempfile.gettempdir() base = temp + '/spa.csv' #  . #        30 ,     web-. #       ,      #      ,         #  . if(not(os.path.exists(base)) or ((int(time.time()) - os.path.getmtime(base)) > 30)): #  HTML . html = urllib.urlopen(url).read() #   -    . #f = codecs.open("text.html", 'r', "utf-8") #html = f.read() #f.close() #    HTML. #     . html = re.sub(r"\n+", " ", html) #    . html = re.sub(r">\s+<", "><", html) #    -    .    #        . html = re.search(r"</COLGROUP>.+?Trunk", html).group(0) #   . count = len(re.findall(r"<td[^>]+><font[^>]+>Line\s(\d+)\sStatus</font>",html)) #    .    HTML      # ,            #  .  . data = re.findall(r"<td>([^<:>]+):.+?<font[^>]+>([^<]*)</font>",html) #  CSV . number = 0 rows = [] #   . rows.append(['info']) count += 1 for i in range (1, count): rows.append(['line' + str(i)]) count -= 1 #  .          # .         ,   #    ,   ,      #    ,    ,   .     #     -  Hook State.        #    ,    -  . #    . for entry in data: # ,        . if(entry[0] == 'Hook State'): number += 1 #    ,   Call 1 Forward    . if(not(re.match(r'Call\s\d+\s', entry[0]))): value = entry[1] #     .  Zabbix     unixtime. if(((entry[0] == 'Current Time') or (entry[0] == 'Last Registration At')) and (value)): # 1/13/2003 14:03:52 if(value != '0/0/0 00:00:00'): value = int(time.mktime(datetime.datetime.strptime(entry[1], "%m/%d/%Y %H:%M:%S").timetuple())) else: value = 0 #   . if((entry[0] == 'Next Registration In') and (value)): # 1263 s value = int(entry[1].split()[0]) #      . rows[number].extend([value]) #  . with open(base, 'w') as csvfile: writer = csv.writer(csvfile) writer.writerows(rows) csvfile.close() #  ,  ,       .  #  .   ,    - . if(len(sys.argv) > 1): #      ,     . with open(base, 'rb') as csvfile: reader = csv.reader(csvfile) for row in reader: # TODO:  ,   . if(row[0] == sys.argv[1]): line = row csvfile.close() # ,       . if('line' in locals()): # ,      ,    . #   . if(line[0] == 'info'): try: print({ 'name': line[1], 'serial': line[2], 'software': line[3], 'hardware': line[4], 'mac': line[5], 'cert': line[6], 'customization': line[7], 'time': line[8], 'uptime': line[9], 'rtp.packets.sent': line[10], 'rtp.bytes.sent': line[11], 'rtp.packets.recv': line[12], 'rtp.bytes.recv': line[13], 'sip.msg.sent': line[14], 'sip.bytes.sent': line[15], 'sip.msg.recv': line[16], 'sip.bytes.recv': line[17] }.get(sys.argv[2])) #     ,   . except IndexError as e: print('ZBX_UNSUPPORTED') #  . else: try: print({ 'hook.state': line[1], 'reg.state': line[2], 'reg.time': line[3], 'reg.next': line[4], 'mvi': line[5], 'callback': line[6], 'last.called': line[7], 'last.caller': line[8], }.get(sys.argv[2])) except IndexError as e: print('ZBX_UNSUPPORTED') #       ,    . #     Zabbix  . else: print('ZBX_UNSUPPORTED') else: #  autodiscovery  . #  . s = "" #      ,   . with open(base, 'rb') as csvfile: reader = csv.reader(csvfile) for row in reader: #  . if(len(s) > 0): s = s + "," #  JSON  . if(row[0] != 'info'): s = s + '{"{#LINE}":"' + str(row[0]) + '"}' csvfile.close() #   . print('{"data":[' + s + ']}') #   . quit() 


The script must be put in / share / zabbix / externalscripts. If there is no such folder, you need to create it and give access to the Zabbix user to it.

Making the script executable.

 sudo chmod +x /share/zabbix/externalscripts/zabbix_spa8000.py 

We test the correct operation of Autodiscovery.

 /share/zabbix/externalscripts/zabbix_spa8000.py 

If everything is correct, we get about this at the output:

 {"data":[{"{#LINE}":"line1"},{"{#LINE}":"line2"},{"{#LINE}":"line3"},{"{#LINE}":"line4"},{"{#LINE}":"line5"},{"{#LINE}":"line6"},{"{#LINE}":"line7"},{"{#LINE}":"line8"}]} 


We test the correctness of the transfer of parameter values.

 /share/zabbix/externalscripts/zabbix_spa8000.py info serial 

If everything is correct, we get about this at the output:

 CFH01N704858 

Add to Zabbix UserParameter to get data by agent.

 /etc/zabbix_agentd.conf.d/spa8000.conf UserParameter=spa[*],/share/zabbix/externalscripts/zabbix_spa.py $1 $2 UserParameter=spa.lines,/share/zabbix/externalscripts/zabbix_spa.py 

Reboot the Zabbix agent.

 sudo service zabbix-agent restart 

Check that Zabbix agent can receive script data.

 zabbix_agentd -t spa.lines spa.lines [t|{"data":[{"{#LINE}":"line1"},{"{#LINE}":"line2"},{"{#LINE}":"line3"},{"{#LINE}":"line4"},{"{#LINE}":"line5"},{"{#LINE}":"line6"},{"{#LINE}":"line7"},{"{#LINE}":"line8"}]}] zabbix_agentd -t spa[info,serial] spa[info,serial] [t|CFH01N70 4858] 


Where to put?


Template for Zabbix server. It joins the node from which there is access to the SPA web-interface.

Template for Zabbix server
 <?xml version="1.0" encoding="UTF-8"?> <zabbix_export> <version>3.0</version> <date>2016-09-09T11:04:05Z</date> <groups> <group> <name> </name> </group> </groups> <templates> <template> <template>Template_Cisco_Linksys_SPA</template> <name>Template Cisco(Linksys) SPA</name> <description>  Cisco(Linksys) SPA.</description> <groups> <group> <name> </name> </group> </groups> <applications> <application> <name>RTP</name> </application> <application> <name>SIP</name> </application> <application> <name></name> </application> <application> <name></name> </application> </applications> <items> <item> <name></name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,cert]</key> <delay>3600</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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>  SPA.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name></name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,customization]</key> <delay>3600</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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>  SPA  .</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name> </name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,hardware]</key> <delay>3600</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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>   SPA.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>MAC-</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,mac]</key> <delay>3600</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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>- SPA.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name></name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,name]</key> <delay>3600</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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>Hostname SPA.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>  RTP</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,rtp.bytes.recv]</key> <delay>30</delay> <history>30</history> <trends>60</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>   RTP.</description> <inventory_link>0</inventory_link> <applications> <application> <name>RTP</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>  RTP</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,rtp.bytes.sent]</key> <delay>30</delay> <history>30</history> <trends>60</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>   RTP.</description> <inventory_link>0</inventory_link> <applications> <application> <name>RTP</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>  RTP</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,rtp.packets.recv]</key> <delay>30</delay> <history>30</history> <trends>60</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>   RTP.</description> <inventory_link>0</inventory_link> <applications> <application> <name>RTP</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>  RTP</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,rtp.packets.sent]</key> <delay>30</delay> <history>30</history> <trends>60</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>   RTP.</description> <inventory_link>0</inventory_link> <applications> <application> <name>RTP</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name> </name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,serial]</key> <delay>3600</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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>  SPA.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>  SIP</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,sip.bytes.recv]</key> <delay>30</delay> <history>30</history> <trends>60</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>   SIP.</description> <inventory_link>0</inventory_link> <applications> <application> <name>SIP</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>  SIP</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,sip.bytes.sent]</key> <delay>30</delay> <history>30</history> <trends>60</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>   SIP.</description> <inventory_link>0</inventory_link> <applications> <application> <name>SIP</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>  SIP</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,sip.msg.recv]</key> <delay>30</delay> <history>30</history> <trends>60</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>   SIP.</description> <inventory_link>0</inventory_link> <applications> <application> <name>SIP</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>  SIP</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,sip.msg.sent]</key> <delay>30</delay> <history>30</history> <trends>60</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>   SIP.</description> <inventory_link>0</inventory_link> <applications> <application> <name>SIP</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name> </name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,software]</key> <delay>3600</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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>   SPA.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name> </name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,time]</key> <delay>60</delay> <history>30</history> <trends>60</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>  SPA.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name></name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[info,uptime]</key> <delay>60</delay> <history>30</history> <trends>60</trends> <status>0</status> <value_type>3</value_type> <allowed_hosts/> <units>uptime</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>   SPA.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> </item> </items> <discovery_rules> <discovery_rule> <name></name> <type>0</type> <snmp_community/> <snmp_oid/> <key>spa.lines</key> <delay>3600</delay> <status>0</status> <allowed_hosts/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <delay_flex/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <filter> <evaltype>0</evaltype> <formula/> <conditions/> </filter> <lifetime>30</lifetime> <description> SPA.</description> <item_prototypes> <item_prototype> <name> callback  {#LINE}</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[{#LINE},callback]</key> <delay>30</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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> callback  {#LINE}.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> <application_prototypes/> </item_prototype> <item_prototype> <name> Hook  {#LINE}</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[{#LINE},hook.state]</key> <delay>30</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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> Hook  {#LINE}.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> <application_prototypes/> </item_prototype> <item_prototype> <name>    {#LINE}</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[{#LINE},last.called]</key> <delay>30</delay> <history>5</history> <trends>0</trends> <status>0</status> <value_type>4</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>    {#LINE}.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> <application_prototypes/> </item_prototype> <item_prototype> <name>    {#LINE}</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[{#LINE},last.caller]</key> <delay>30</delay> <history>5</history> <trends>0</trends> <status>0</status> <value_type>4</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>    {#LINE}.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> <application_prototypes/> </item_prototype> <item_prototype> <name> MVI  {#LINE}</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[{#LINE},mvi]</key> <delay>30</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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> MVI  {#LINE}.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> <application_prototypes/> </item_prototype> <item_prototype> <name>   {#LINE}</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[{#LINE},reg.next]</key> <delay>30</delay> <history>30</history> <trends>60</trends> <status>0</status> <value_type>3</value_type> <allowed_hosts/> <units>uptime</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>     {#LINE}.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> <application_prototypes/> </item_prototype> <item_prototype> <name>   {#LINE}</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[{#LINE},reg.state]</key> <delay>30</delay> <history>10</history> <trends>0</trends> <status>0</status> <value_type>4</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>   {#LINE}.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> <application_prototypes/> </item_prototype> <item_prototype> <name>    {#LINE}</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>spa[{#LINE},reg.time]</key> <delay>30</delay> <history>30</history> <trends>60</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>    {#LINE}.</description> <inventory_link>0</inventory_link> <applications> <application> <name></name> </application> </applications> <valuemap/> <logtimefmt/> <application_prototypes/> </item_prototype> </item_prototypes> <trigger_prototypes> <trigger_prototype> <expression>{Template_Cisco_Linksys_SPA:spa[{#LINE},reg.state].count(#2,Registered,eq,0)}<2</expression> <name>   {#LINE}</name> <url/> <status>0</status> <priority>4</priority> <description> {#LINE}      1 .</description> <type>0</type> <dependencies/> </trigger_prototype> </trigger_prototypes> <graph_prototypes/> <host_prototypes/> </discovery_rule> </discovery_rules> <macros/> <templates/> <screens/> </template> </templates> <triggers> <trigger> <expression>{Template_Cisco_Linksys_SPA:spa[info,uptime].last()}<180</expression> <name>SPA </name> <url/> <status>0</status> <priority>2</priority> <description>  SPA  3 .</description> <type>0</type> <dependencies/> </trigger> </triggers> </zabbix_export> 


What is the result?


Zabbix , , , . . , .

PS I hope someone will come in handy. I will be glad to your comments.

Source: https://habr.com/ru/post/330346/


All Articles