mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
the trailing spaces hunt continues...
git-svn-id: http://www.observium.org/svn/observer/trunk@1867 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
parent
f639ef3034
commit
50f873bffc
@ -2,11 +2,11 @@
|
||||
<?php
|
||||
|
||||
include("includes/defaults.inc.php");
|
||||
include("config.php");
|
||||
include("config.php");
|
||||
include("includes/functions.php");
|
||||
|
||||
if (isset($argv[1]) && $argv[1])
|
||||
{
|
||||
{
|
||||
$host = strtolower($argv[1]);
|
||||
$community = $argv[2];
|
||||
$snmpver = strtolower($argv[3]);
|
||||
|
12
adduser.php
12
adduser.php
@ -13,21 +13,21 @@ else
|
||||
{
|
||||
echo("ERROR: no valid auth_mechanism defined.\n");
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (auth_usermanagement())
|
||||
{
|
||||
if ($argv[1] && $argv[2] && $argv[3])
|
||||
if ($argv[1] && $argv[2] && $argv[3])
|
||||
{
|
||||
if (adduser($argv[1],$argv[2],$argv[3],$argv[4]))
|
||||
{
|
||||
echo("User ".$argv[1]." added successfully\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("Add User Tool\nUsage: ./adduser.php <username> <password> <level 1-10> [email]\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ if ($errored)
|
||||
{ ## If there are errored ports
|
||||
$i=0;
|
||||
$msg = "Interfaces with errors : \n\n";
|
||||
|
||||
|
||||
foreach ($errored as $int)
|
||||
{
|
||||
$msg .= "$int\n"; ## Add a line to the report email warning about them
|
||||
|
@ -7,7 +7,7 @@ include("includes/defaults.inc.php");
|
||||
include("config.php");
|
||||
include("includes/functions.php");
|
||||
|
||||
$query = "SELECT *,A.id as id FROM ipv4_addresses AS A, ports as I, devices as D
|
||||
$query = "SELECT *,A.id as id FROM ipv4_addresses AS A, ports as I, devices as D
|
||||
WHERE A.interface_id = I.interface_id AND I.device_id = D.device_id AND D.status = '1'";
|
||||
|
||||
$data = mysql_query($query);
|
||||
@ -33,7 +33,7 @@ $query = mysql_query($sql);
|
||||
while ($device = mysql_fetch_array($query))
|
||||
{
|
||||
echo($device['hostname'] . " \n\n");
|
||||
|
||||
|
||||
$oids = snmp_walk($device, "ipAddressIfIndex.ipv6", "-Osq");
|
||||
$oids = str_replace("ipAddressIfIndex.ipv6.", "", $oids);
|
||||
$oids = str_replace("\"", "", $oids); $oids = trim($oids);
|
||||
@ -87,7 +87,7 @@ while ($interface = mysql_fetch_array($interface_query))
|
||||
{
|
||||
mysql_query("delete from ports where `interface_id` = '$interface_id'");
|
||||
echo("Deleting if $interface_id \n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo(mysql_result(mysql_query("SELECT COUNT(*) FROM `ports`"), 0) . " ports at end\n");
|
||||
@ -134,7 +134,7 @@ while ($link = mysql_fetch_array($link_query))
|
||||
mysql_query("delete from adjacencies where `adj_id` = '$id'");
|
||||
echo("Deleting link $id (".$link['cidr']." - ". $link['hostname'] ." - ". $link['ifDescr'] .")\n");
|
||||
}
|
||||
|
||||
|
||||
unset($remove);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ function snmp_get_multi($device, $oids, $options = "-OQUs", $mib = NULL, $mibdir
|
||||
$retries = $config['snmp']['retries'];
|
||||
}
|
||||
|
||||
if (!isset($device['transport']))
|
||||
if (!isset($device['transport']))
|
||||
{
|
||||
$device['transport'] = "udp";
|
||||
}
|
||||
@ -255,7 +255,7 @@ function snmpwalk_cache_cip($device, $oid, $array, $mib = 0)
|
||||
$cmd .= " -M ".$config['install_dir']."/mibs/";
|
||||
if (isset($timeout)) { $cmd .= " -t " . $timeout; }
|
||||
if (isset($retries)) { $cmd .= " -r " . $retries; }
|
||||
|
||||
|
||||
$cmd .= " ".$device['transport'].":".$device['hostname'].":".$device['port']." ".$oid;
|
||||
|
||||
if (!$debug) { $cmd .= " 2>/dev/null"; }
|
||||
|
Loading…
Reference in New Issue
Block a user