interface operational status monitor(php's snmp module)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
hack988
Posts: 1
Joined: Wed Nov 25, 2009 12:15 pm

interface operational status monitor(php's snmp module)

Post by hack988 »

FAQ
An WARNING: Result from SNMP not valid. Partial Result:U in Cacti logs
php_snmp module return ifOperStatus like this:
Up(1)
Down(2)
so you must modify lib/snmp.php

1.PHP Load
Enable php_snmp module

2.Source Modify
resource/snmp_queries/interface.xml
add

Code: Select all



		<ifOperStatusOut>
			<name>Status</name>
			<method>walk</method>
			<source>VALUE/REGEXP:[a-zA-Z]{1,}\(([1-9]{1})+\)$</source>
			<direction>output</direction>
			<oid>.1.3.6.1.2.1.2.2.1.8</oid>
		</ifOperStatusOut>
lib/snmp.php
line

Code: Select all

define("REGEXP_SNMP_TRIM".....
change to

Code: Select all

define("REGEXP_SNMP_TRIM", "(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|([a-zA-Z]{1,}\()|\)$");
4.Import Templates
cacti_data_query_snmp_-_interface_statistics_done.xml
cacti_data_template_interface_-_link_status_done.xml
cacti_graph_template_interface_-_link_status_done.xml

5.CDEF Setting
Add an CDEF Named Link Display
Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Custom String: 0,IF,CEIL


Link Display
Link Dormant
Link Down
Link Lower Layer Down
Link Not Present
Link Testing
Link Unkown
Link Up

Item #3 Another CDEF: Link Display
Attachments
Simple
Simple
simple.JPG (22.59 KiB) Viewed 1728 times
cacti_data_query_snmp_-_interface_statistics_done.xml
Data Query
(22.92 KiB) Downloaded 164 times
cacti_data_template_interface_-_link_status_done.xml
Data Template
(7.76 KiB) Downloaded 195 times
cacti_graph_template_interface_-_link_status_done.xml
Graph Template
(19.88 KiB) Downloaded 213 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests