"Fossies" - the Fresh Open Source Software Archive 
Member "node-runner-0.6.0/include/query_snmp.php" (17 Aug 2004, 641 Bytes) of package /linux/www/old/node-runner-0.6.0.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "query_snmp.php" see the
Fossies "Dox" file reference documentation.
1 <?php
2
3 array_push($queries_type_array, "SNMP");
4
5 function snmp_query($description, $ipaddress, $community, $ptime) {
6 global $debug;
7
8 $status = array();
9
10 // Retrieve system name
11 $socket = snmpget($ipaddress, $community, "system.sysName.0", $ptime);
12
13 if (!$socket) {
14 $status[0] = 0;
15 $status[1] = $description." DOWN";
16 if ($debug == 1) { $status[1] .= " - SNMP Error Reading system.sysName.0 Object ID."; }
17 } else {
18 $status[0] = 1;
19 $status[1] = $description." UP";
20 if ($debug == 1) { $status[1] .= " - ".$socket; }
21 }
22
23 if ($socket) { fclose($socket); }
24
25 $status[1] .= "\n";
26 return $status;
27
28 }
29
30 ?>