~budgester/irm/trunk

« back to all changes in this revision

Viewing changes to users/snmp-stat.php

  • Committer: budgester at budgester
  • Date: 2008-03-05 23:14:13 UTC
  • Revision ID: budgester@budgester.com-20080305231413-k5vqfuckfo09ju42
Initial import of IRM codebase

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
#    IRM - The Information Resource Manager
 
3
#    Copyright (C) 2000 Yann Ramin
 
4
#
 
5
#    This program is free software; you can redistribute it and/or modify
 
6
#    it under the terms of the GNU General Public License as published by
 
7
#    the Free Software Foundation; either version 2 of the License, or
 
8
#    (at your option) any later version.
 
9
#
 
10
#    This program is distributed in the hope that it will be useful,
 
11
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
#    GNU General Public License (in file COPYING) for more details.
 
14
#
 
15
#    You should have received a copy of the GNU General Public License
 
16
#    along with this program; if not, write to the Free Software
 
17
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
#
 
19
################################################################################
 
20
 
 
21
require_once '../include/irm.inc';
 
22
require_once 'lib/Config.php';
 
23
require_once 'include/i18n.php';
 
24
require_once 'lib/Net_SNMP.php';
 
25
 
 
26
AuthCheck("normal");
 
27
 
 
28
commonHeader(_("SNMP Status"));
 
29
 
 
30
$DB = Config::Database();
 
31
$qID = $DB->getTextValue($_GET['ID']);
 
32
$devicetype = ($_GET['device']);
 
33
 
 
34
$query = "SELECT * FROM $devicetype WHERE ID = $qID";
 
35
$result = $DB->getRow($query);
 
36
$ip = $result["ip"];
 
37
$name = $result["name"];
 
38
$id=$_GET['ID'];
 
39
 
 
40
$snmp = new Net_SNMP($ip);
 
41
$hstatus = $snmp->SNMPHTMLping();
 
42
$uptime = $snmp->snmpget("system.sysUpTime.0");
 
43
 
 
44
$userbase = Config::AbsLoc('users');
 
45
 
 
46
PRINT "<table>\n";
 
47
PRINT "<tr>";
 
48
PRINT "<th>"._("Name")."</th>";
 
49
PRINT "<th>"._("Status")."</th>";
 
50
PRINT "<th>" . _("Uptime*") . "</th>";
 
51
PRINT "<th>" . _("IP") . "</th>";
 
52
PRINT "</tr>";
 
53
 
 
54
PRINT "<tr>";
 
55
PRINT "<td>$name ($id)</td>";
 
56
PRINT "<td>$hstatus</td>";
 
57
PRINT "<td>".$uptime["Value"]."</td>";
 
58
PRINT "<td>$ip</td>";
 
59
PRINT "</tr>";
 
60
 
 
61
PRINT "</table>";
 
62
 
 
63
PRINT "<p><h3>" . _("Browse MIBS") . "</h3>";
 
64
PRINT "<a href=\"$userbase/snmp-browse.php?browse=system&ID=$id&device=$device\">";
 
65
__("System");
 
66
PRINT "</a><br>";
 
67
PRINT "<a href=\"$userbase/snmp-browse.php?browse=interfaces&ID=$id&device=$device\">";
 
68
__("Network Interfaces");
 
69
PRINT "</a><br>";
 
70
PRINT "<a href=\"$userbase/snmp-browse.php?browse=ip&ID=$id&device=$device\">";
 
71
__("IP Stats");
 
72
PRINT "</a><br>";
 
73
PRINT "<a href=\"$userbase/snmp-browse.php?browse=HOST-RESOURCES-MIB::hrStorageEntry&ID=$id&device=$device\">";
 
74
__("Storage");
 
75
PRINT "</a><br>";
 
76
PRINT "<a href=\"$userbase/snmp-browse.php?browse=.1&ID=$id&device=$device\">";
 
77
__("Browse all common MIBS. ATTENTION this can take very long time.");
 
78
PRINT "</a>";
 
79
 
 
80
PRINT "<p><i>";
 
81
__("* Uptime here reflects SNMP agent uptime, not computer uptime!");
 
82
PRINT "</i>";
 
83
commonFooter();