QLogic SANbox 5600 templates?
Moderators: Developers, Moderators
QLogic SANbox 5600 templates?
Need to get statistics from subj ports. Its fiber channel switch. I download MIB from qlogic site, but...
I try to write own xml, like interface.xml, for query data from ports...
Xml - ready.... What i need to do? I want to get query like "interface statistics"...
May be somebody already write this queries, and can get it to me?
ps. Where documentation about create own queries, templates, source?
I try to write own xml, like interface.xml, for query data from ports...
Xml - ready.... What i need to do? I want to get query like "interface statistics"...
May be somebody already write this queries, and can get it to me?
ps. Where documentation about create own queries, templates, source?
i create templates for QLogic SANBox 5600 optical switch.
I did it!
I create templates for switch. Its work like "interface statistics". Show statistics in bytes, frames, and discard frames.
But... While you create graph, you select ports in switch. From snmp oid 1.3.6.1.2.1.75.1.2.2.1.2.1.x return 1, if port have status "online", and 2, port status "offline". I dont know, how replace number "1" or "2" in word "online" or "offline". Any thinks?
ps Sorry, for my bad english - its not my native language.
I create templates for switch. Its work like "interface statistics". Show statistics in bytes, frames, and discard frames.
But... While you create graph, you select ports in switch. From snmp oid 1.3.6.1.2.1.75.1.2.2.1.2.1.x return 1, if port have status "online", and 2, port status "offline". I dont know, how replace number "1" or "2" in word "online" or "offline". Any thinks?
ps Sorry, for my bad english - its not my native language.
- Attachments
-
- sanbox5600.tar.gz
- QLogic SANBox 5600 optical switch templates for monitoring ports.
- (7.62 KiB) Downloaded 1257 times
- kwabbernoot
- Cacti User
- Posts: 99
- Joined: Mon Oct 13, 2003 4:11 am
- Location: Zottegem, Belgium
Re: i create templates for QLogic SANBox 5600 optical switch
Maybe this code can help, the temperature sensors of an ancient Compaq system also used numbers to specifiy the location and this is how I resolved the issue in a Cacti Data queryWearWolf wrote: But... While you create graph, you select ports in switch. From snmp oid 1.3.6.1.2.1.75.1.2.2.1.2.1.x return 1, if port have status "online", and 2, port status "offline". I dont know, how replace number "1" or "2" in word "online" or "offline". Any thinks?
Code: Select all
<?php
$no_http_headers = true;
//include("../include/config.php");
//include("../include/snmp.php");
include(dirname(__FILE__) . "/../include/config.php");
include(dirname(__FILE__) . "/../lib/snmp.php");
$oids = array(
"temperature" => ".1.3.6.1.4.1.232.6.2.6.8.1.4.0",
"threshold" => ".1.3.6.1.4.1.232.6.2.6.8.1.5.0",
"index" => ".1.3.6.1.4.1.232.6.2.6.8.1.2",
"location" => ".1.3.6.1.4.1.232.6.2.6.8.1.3.0"
);
$hostname = $_SERVER["argv"][1];
$snmp_community = $_SERVER["argv"][2];
$snmp_version = $_SERVER["argv"][3];
$cmd = $_SERVER["argv"][4];
if ($cmd == "index") {
$return_arr = reindex(cacti_snmp_walk($hostname, $snmp_community, $oids["index"], $snmp_version, "", "", 161, 1000));
for ($i=0;($i<sizeof($return_arr));$i++) {
// print $return_arr[$i]["value"] . "\n";
print $return_arr[$i] . "\n";
}
}elseif ($cmd == "query") {
$arg = $_SERVER["argv"][5];
// Add ".0", Compaq OID have an addition 0 in their OID
$arr_index = reindex(cacti_snmp_walk($hostname, $snmp_community, $oids["index"], $snmp_version, "", "", 161, 1000));
$arr = reindex(cacti_snmp_walk($hostname, $snmp_community, $oids[$arg], $snmp_version, "", "", 161, 1000));
for ($i=0;($i<sizeof($arr_index));$i++) {
if ($arg == "location") {
$locatio = realloc($arr[$i]);
print $arr_index[$i] . "!" . $locatio . "\n";
} else {
print $arr_index[$i] . "!" . $arr[$i] . "\n";
}
}
}elseif ($cmd == "get") {
$arg = $_SERVER["argv"][5];
$index = $_SERVER["argv"][6];
// Add ".0", Compaq OID have an addition 0 in their OID
print (cacti_snmp_get($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, "", "", 161, 1000));
}
function reindex($arr) {
$return_arr = array();
for ($i=0;($i<sizeof($arr));$i++) {
$return_arr[$i] = $arr[$i]["value"];
}
return $return_arr;
}
//Function to detect sensor location (Enums in Getif)
function realloc($locarr) {
$compaqloc = array(
"Other",
"Unknown",
"System",
"SystemBoard",
"ioBoard",
"CPU",
"Memory",
"Storage",
"RemovableMedia",
"PowerSupply"
);
for ($c=1;($c<=10);$c++) {
if ($locarr == $c) {
$loc = $compaqloc[$c-1];
}
}
return $loc;
}
?>
Regards,
Kwabbernoot
OS : [b]Slackware 10.2.0[/b]
Cacti : [b]0.8.6j[/b]
Cactid : [b]0.8.6j[/b]
Apache : [b]1.3.34[/b]
PHP : [b]5.1.4[/b]
MySQL : [b]4.1.21[/b]
RRDTool : [b]1.2.12[/b]
Net-SNMP : [b]5.3.0[/b]
Kwabbernoot
OS : [b]Slackware 10.2.0[/b]
Cacti : [b]0.8.6j[/b]
Cactid : [b]0.8.6j[/b]
Apache : [b]1.3.34[/b]
PHP : [b]5.1.4[/b]
MySQL : [b]4.1.21[/b]
RRDTool : [b]1.2.12[/b]
Net-SNMP : [b]5.3.0[/b]
-
- Posts: 9
- Joined: Thu Nov 01, 2007 10:17 am
Likely a dead thread, but thought I would ask.
Is their an associated php script that goes with these xml files?
I have imported the xml files and copied them into cacti/resource/script_queries/, but there is ussually a php scipt that goes in cacti/scripts/.
I see the SANBOX info in templates area, but not SANBOX in data queries and it does show me having the option to select them for a host associated queries.
Is their an associated php script that goes with these xml files?
I have imported the xml files and copied them into cacti/resource/script_queries/, but there is ussually a php scipt that goes in cacti/scripts/.
I see the SANBOX info in templates area, but not SANBOX in data queries and it does show me having the option to select them for a host associated queries.
-
- Posts: 9
- Joined: Thu Nov 01, 2007 10:17 am
I should clarify, I see above a script for temp sensors. I need one for read/write port stats.
david(dallas) wrote:Likely a dead thread, but thought I would ask.
Is their an associated php script that goes with these xml files?
I have imported the xml files and copied them into cacti/resource/script_queries/, but there is ussually a php scipt that goes in cacti/scripts/.
I see the SANBOX info in templates area, but not SANBOX in data queries and it does show me having the option to select them for a host associated queries.
-
- Posts: 13
- Joined: Mon Dec 04, 2006 6:18 am
Sorry to lift this up but i've tried using this and get the following errors:
Notice: Undefined index: oid_index in C:\htdocs\cacti\lib\data_query.php on line 167
Notice: Undefined index: oid_index in C:\htdocs\cacti\lib\data_query.php on line 172
Warning: Variable passed to each() is not an array or object in C:\htdocs\cacti\lib\data_query.php on line 539
Warning: Cannot modify header information - headers already sent by (output started at C:\htdocs\cacti\lib\data_query.php:167) in C:\htdocs\cacti\host.php on line 79
Notice: Undefined index: oid_index in C:\htdocs\cacti\lib\data_query.php on line 167
Notice: Undefined index: oid_index in C:\htdocs\cacti\lib\data_query.php on line 172
Warning: Variable passed to each() is not an array or object in C:\htdocs\cacti\lib\data_query.php on line 539
Warning: Cannot modify header information - headers already sent by (output started at C:\htdocs\cacti\lib\data_query.php:167) in C:\htdocs\cacti\host.php on line 79
Sorry about this, but i forget about this file...david(dallas) wrote:Likely a dead thread, but thought I would ask.
Is their an associated php script that goes with these xml files?
I have imported the xml files and copied them into cacti/resource/script_queries/, but there is ussually a php scipt that goes in cacti/scripts/.
I see the SANBOX info in templates area, but not SANBOX in data queries and it does show me having the option to select them for a host associated queries.
Just add it in cacti/scripts/
- Attachments
-
- sanbox_ports.xml
- (1.68 KiB) Downloaded 1032 times
Re: QLogic SANbox 5600 templates?
When I debug the data query "SNMP - SanBox Ports" with "Verbose Query", I get the following output:WearWolf wrote: Sorry about this, but i forget about this file...
Just add it in cacti/scripts/
+ Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/sanbox_ports.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.75.1.1.4.1.6.1'
+ No SNMP data returned
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/sanbox_ports.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/sanbox_ports.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/sanbox_ports.xml'
What could be wrong?
Re: QLogic SANbox 5600 templates?
I got the same problem ;(GrL wrote:When I debug the data query "SNMP - SanBox Ports" with "Verbose Query", I get the following output:WearWolf wrote: Sorry about this, but i forget about this file...
Just add it in cacti/scripts/
+ Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/sanbox_ports.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.75.1.1.4.1.6.1'
+ No SNMP data returned
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/sanbox_ports.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/sanbox_ports.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/sanbox_ports.xml'
What could be wrong?
The thing is that if i manually try to fetch '.1.3.6.1.2.1.75.1.1.4.1.6.1' I get snmp reply ..
Code: Select all
$ snmpwalk -c cacti -v 2c 10.11.12.13 1.3.6.1.2.1.75.1.1.4.1.6.1
SNMPv2-SMI::mib-2.75.1.1.4.1.6.1 = Gauge32: 20
-
- Posts: 3
- Joined: Fri May 27, 2011 3:14 pm
Re: QLogic SANbox 5600 templates?
Did you get any response to this?
Is the version of cacti being used a possible cause?
Thanks
Is the version of cacti being used a possible cause?
Thanks
Re: QLogic SANbox 5600 templates?
i think i figured out what is going on here. there are two lines in the sanbox_ports.xml file which were wrong.
it should say
<oid_indexes>.1.3.6.1.2.1.75.1.1.4.1.6.1</oid_indexes>
<oid_index>.1.3.6.1.2.1.75.1.2.2.1.2.1</oid_index>
the oid's were backwards.
it should say
<oid_indexes>.1.3.6.1.2.1.75.1.1.4.1.6.1</oid_indexes>
<oid_index>.1.3.6.1.2.1.75.1.2.2.1.2.1</oid_index>
the oid's were backwards.
-
- Posts: 3
- Joined: Fri May 27, 2011 3:14 pm
Re: QLogic SANbox 5600 templates?
I had that set correctly already in the version of the file that I have.
I did find though that reverting back to an older version of cacti worked for me - 0.8.6h
I did find though that reverting back to an older version of cacti worked for me - 0.8.6h
Re: QLogic SANbox 5600 templates?
i did make one other change to the xml file, which was to replace, at the beginning and end, the tag <interface> with <query>
The documentation I looked at said to use <query> so perhaps it is version dependent.
The documentation I looked at said to use <query> so perhaps it is version dependent.
Who is online
Users browsing this forum: No registered users and 0 guests