2
# IRM - The Information Resource Manager
3
# Copyright (C) 2000 Yann Ramin
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.
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.
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.
19
################################################################################
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';
28
commonHeader(_("SNMP Status"));
30
$DB = Config::Database();
31
$qID = $DB->getTextValue($_GET['ID']);
32
$devicetype = ($_GET['device']);
34
$query = "SELECT * FROM $devicetype WHERE ID = $qID";
35
$result = $DB->getRow($query);
37
$name = $result["name"];
40
$snmp = new Net_SNMP($ip);
41
$hstatus = $snmp->SNMPHTMLping();
42
$uptime = $snmp->snmpget("system.sysUpTime.0");
44
$userbase = Config::AbsLoc('users');
48
PRINT "<th>"._("Name")."</th>";
49
PRINT "<th>"._("Status")."</th>";
50
PRINT "<th>" . _("Uptime*") . "</th>";
51
PRINT "<th>" . _("IP") . "</th>";
55
PRINT "<td>$name ($id)</td>";
56
PRINT "<td>$hstatus</td>";
57
PRINT "<td>".$uptime["Value"]."</td>";
63
PRINT "<p><h3>" . _("Browse MIBS") . "</h3>";
64
PRINT "<a href=\"$userbase/snmp-browse.php?browse=system&ID=$id&device=$device\">";
67
PRINT "<a href=\"$userbase/snmp-browse.php?browse=interfaces&ID=$id&device=$device\">";
68
__("Network Interfaces");
70
PRINT "<a href=\"$userbase/snmp-browse.php?browse=ip&ID=$id&device=$device\">";
73
PRINT "<a href=\"$userbase/snmp-browse.php?browse=HOST-RESOURCES-MIB::hrStorageEntry&ID=$id&device=$device\">";
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.");
81
__("* Uptime here reflects SNMP agent uptime, not computer uptime!");