diff --git a/addhost.php b/addhost.php index a6b7385a1..d33fc00e0 100755 --- a/addhost.php +++ b/addhost.php @@ -47,7 +47,7 @@ if (!empty($argv[1])) { $v3['authlevel'] = "noAuthNoPriv"; $v3args = array_slice($argv, 4); - + while ($arg = array_shift($v3args)) { // parse all remaining args @@ -71,7 +71,7 @@ if (!empty($argv[1])) { array_push($config['snmp']['v3'], $v3); } $device_id = addHost($host, $snmpver, $port, $transport); - + } elseif ($seclevel === "anp" or $seclevel === "authNoPriv") { @@ -97,10 +97,10 @@ if (!empty($argv[1])) $v3['authalgo'] = $arg; } } - + array_push($config['snmp']['v3'], $v3); $device_id = addHost($host, $snmpver, $port, $transport); - + } elseif ($seclevel === "ap" or $seclevel === "authPriv") { @@ -130,10 +130,10 @@ if (!empty($argv[1])) $v3['cryptoalgo'] = $arg; } } - + array_push($config['snmp']['v3'], $v3); $device_id = addHost($host, $snmpver, $port, $transport); - + } else { @@ -165,7 +165,7 @@ if (!empty($argv[1])) { $config['snmp']['community'] = array($community); } - + $device_id = addHost($host, $snmpver, $port, $transport); } @@ -199,7 +199,7 @@ Usage (SNMPv1/2c): ./addhost.php <%Whostname%n> [community] [v1|v2c] [port] [" . Usage (SNMPv3) : Config Defaults : ./addhost.php <%Whostname%n> any v3 [user] [port] [" . implode("|",$config['snmp']['transports']) . "] No Auth, No Priv : ./addhost.php <%Whostname%n> nanp v3 [user] [port] [" . implode("|",$config['snmp']['transports']) . "] Auth, No Priv : ./addhost.php <%Whostname%n> anp v3 [md5|sha1] [port] [" . implode("|",$config['snmp']['transports']) . "] - Auth, Priv : ./addhost.php <%Whostname%n> ap v3 [md5|sha1] [aes|dsa] [port] [" . implode("|",$config['snmp']['transports']) . "] + Auth, Priv : ./addhost.php <%Whostname%n> ap v3 [md5|sha1] [aes|dsa] [port] [" . implode("|",$config['snmp']['transports']) . "] %rRemember to run discovery for the host afterwards.%n "); diff --git a/html/includes/device-header.inc.php b/html/includes/device-header.inc.php index 70784fd53..d332e4fdf 100644 --- a/html/includes/device-header.inc.php +++ b/html/includes/device-header.inc.php @@ -52,7 +52,6 @@ echo(' $graph_array['width'] = "150"; $graph_array['bg'] = "FFFFFF00"; - foreach ($graphs as $entry) { $graph_array['type'] = $entry['graph']; diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 813e2c1a1..b87909980 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -177,7 +177,7 @@ function generate_graph_popup($graph_array) $graph_array['from'] = $config['time']['year']; $content .= generate_graph_tag($graph_array); $content .= ""; - + $graph_array['from'] = $original_from; $graph_array['link'] = generate_url($graph_array, array('page' => 'graphs', 'height' => NULL, 'width' => NULL, 'bg' => NULL)); diff --git a/html/includes/graphs/application/memcached_data.inc.php b/html/includes/graphs/application/memcached_data.inc.php index 62677a672..6aec349b6 100644 --- a/html/includes/graphs/application/memcached_data.inc.php +++ b/html/includes/graphs/application/memcached_data.inc.php @@ -22,7 +22,7 @@ if (is_file($rrd_filename)) $rrd_list[$i]['descr'] = $vars['descr']; $rrd_list[$i]['ds'] = $ds; $rrd_list[$i]['colour'] = $vars['colour']; - if(!empty($vars['areacolour'])) { $rrd_list[$i]['areacolour'] = $vars['areacolour']; } + if (!empty($vars['areacolour'])) { $rrd_list[$i]['areacolour'] = $vars['areacolour']; } $i++; } } else { diff --git a/html/includes/graphs/application/memcached_items.inc.php b/html/includes/graphs/application/memcached_items.inc.php index 2e19cbb2a..5d8b41d36 100644 --- a/html/includes/graphs/application/memcached_items.inc.php +++ b/html/includes/graphs/application/memcached_items.inc.php @@ -21,7 +21,7 @@ if (is_file($rrd_filename)) $rrd_list[$i]['descr'] = $vars['descr']; $rrd_list[$i]['ds'] = $ds; $rrd_list[$i]['colour'] = $vars['colour']; - if(!empty($vars['areacolour'])) { $rrd_list[$i]['areacolour'] = $vars['areacolour']; } + if (!empty($vars['areacolour'])) { $rrd_list[$i]['areacolour'] = $vars['areacolour']; } $i++; } } else { diff --git a/html/includes/graphs/application/memcached_threads.inc.php b/html/includes/graphs/application/memcached_threads.inc.php index 3ebf18ffe..1802f44e7 100644 --- a/html/includes/graphs/application/memcached_threads.inc.php +++ b/html/includes/graphs/application/memcached_threads.inc.php @@ -2,6 +2,7 @@ include("memcached.inc.php"); include("includes/graphs/common.inc.php"); + $device = device_by_id_cache($vars['id']); include("includes/graphs/common.inc.php"); diff --git a/html/includes/graphs/device/hr_processes.inc.php b/html/includes/graphs/device/hr_processes.inc.php index eacdf9fc3..290f40838 100644 --- a/html/includes/graphs/device/hr_processes.inc.php +++ b/html/includes/graphs/device/hr_processes.inc.php @@ -18,6 +18,4 @@ $unit_text = "Processes"; include("includes/graphs/generic_simplex.inc.php"); - - ?> diff --git a/html/includes/graphs/device/hr_users.inc.php b/html/includes/graphs/device/hr_users.inc.php index 644dbdd76..a8469e174 100644 --- a/html/includes/graphs/device/hr_users.inc.php +++ b/html/includes/graphs/device/hr_users.inc.php @@ -18,6 +18,4 @@ $unit_text = "Processes"; include("includes/graphs/generic_simplex.inc.php"); - - ?> diff --git a/html/includes/graphs/device/netstat_icmp.inc.php b/html/includes/graphs/device/netstat_icmp.inc.php index cc9898a0d..c84409fac 100644 --- a/html/includes/graphs/device/netstat_icmp.inc.php +++ b/html/includes/graphs/device/netstat_icmp.inc.php @@ -1,6 +1,5 @@ '00cc00', diff --git a/html/includes/graphs/device/netstat_icmp_info.inc.php b/html/includes/graphs/device/netstat_icmp_info.inc.php index 301dca775..9d029320a 100644 --- a/html/includes/graphs/device/netstat_icmp_info.inc.php +++ b/html/includes/graphs/device/netstat_icmp_info.inc.php @@ -1,6 +1,5 @@ array(), diff --git a/html/includes/graphs/device/netstat_ip.inc.php b/html/includes/graphs/device/netstat_ip.inc.php index e7c809381..35fd810b0 100644 --- a/html/includes/graphs/device/netstat_ip.inc.php +++ b/html/includes/graphs/device/netstat_ip.inc.php @@ -1,6 +1,5 @@ array(), diff --git a/html/includes/graphs/device/netstat_ip_frag.inc.php b/html/includes/graphs/device/netstat_ip_frag.inc.php index bf40df065..3fc3ba3ca 100644 --- a/html/includes/graphs/device/netstat_ip_frag.inc.php +++ b/html/includes/graphs/device/netstat_ip_frag.inc.php @@ -2,7 +2,6 @@ include("includes/graphs/common.inc.php"); - $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-ip.rrd"; $rrd_options .= " DEF:ipInDelivers=$rrd_filename:ipInDelivers:AVERAGE"; diff --git a/html/includes/graphs/device/netstat_snmp.inc.php b/html/includes/graphs/device/netstat_snmp.inc.php index 523df316e..0a0bd9704 100644 --- a/html/includes/graphs/device/netstat_snmp.inc.php +++ b/html/includes/graphs/device/netstat_snmp.inc.php @@ -1,6 +1,5 @@ "300") { $descr_len = "40"; } else { $descr_len = "22"; } $rrd_options .= " -l 0 -E "; diff --git a/html/includes/graphs/device/toner.inc.php b/html/includes/graphs/device/toner.inc.php index 002cd98e1..be6736e8e 100644 --- a/html/includes/graphs/device/toner.inc.php +++ b/html/includes/graphs/device/toner.inc.php @@ -2,7 +2,6 @@ include("includes/graphs/common.inc.php"); - $rrd_options .= " -l 0 -E "; $iter = "1"; diff --git a/html/includes/graphs/device/uptime.inc.php b/html/includes/graphs/device/uptime.inc.php index 254dd8379..20235f654 100644 --- a/html/includes/graphs/device/uptime.inc.php +++ b/html/includes/graphs/device/uptime.inc.php @@ -4,7 +4,6 @@ $scale_min = "0"; include("includes/graphs/common.inc.php"); - $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/uptime.rrd"; $rrd_options .= " DEF:uptime=".$rrd_filename.":uptime:AVERAGE"; diff --git a/html/includes/graphs/device/vpdn_sessions_l2tp.inc.php b/html/includes/graphs/device/vpdn_sessions_l2tp.inc.php index 49ba67bc6..dd203415a 100644 --- a/html/includes/graphs/device/vpdn_sessions_l2tp.inc.php +++ b/html/includes/graphs/device/vpdn_sessions_l2tp.inc.php @@ -2,7 +2,6 @@ include("includes/graphs/common.inc.php"); - $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/vpdn-l2tp.rrd"; $stats = array('sessions'); diff --git a/html/includes/graphs/device/vpdn_tunnels_l2tp.inc.php b/html/includes/graphs/device/vpdn_tunnels_l2tp.inc.php index 67f29f0a4..36d6c0fb1 100644 --- a/html/includes/graphs/device/vpdn_tunnels_l2tp.inc.php +++ b/html/includes/graphs/device/vpdn_tunnels_l2tp.inc.php @@ -2,7 +2,6 @@ include("includes/graphs/common.inc.php"); - $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/vpdn-l2tp.rrd"; $stats = array('tunnels'); diff --git a/html/includes/graphs/device/wifi_clients.inc.php b/html/includes/graphs/device/wifi_clients.inc.php index 791af6fd5..0ff024df4 100644 --- a/html/includes/graphs/device/wifi_clients.inc.php +++ b/html/includes/graphs/device/wifi_clients.inc.php @@ -2,7 +2,6 @@ include("includes/graphs/common.inc.php"); - $rrd_options .= " -l 0 -E "; $radio1 = $config['rrd_dir'] . "/".$device['hostname']."/wificlients-radio1.rrd"; diff --git a/html/includes/graphs/generic_multi_data_separated.inc.php b/html/includes/graphs/generic_multi_data_separated.inc.php index 57e422e9c..146b00914 100644 --- a/html/includes/graphs/generic_multi_data_separated.inc.php +++ b/html/includes/graphs/generic_multi_data_separated.inc.php @@ -96,7 +96,7 @@ if(!$nototal) $rrd_options .= " CDEF:inbits=inoctets,8,*"; $rrd_options .= " CDEF:outbits=outoctets,8,*"; $rrd_options .= " CDEF:doutbits=doutoctets,8,*"; - + $rrd_options .= " VDEF:95thin=inbits,95,PERCENT"; $rrd_options .= " VDEF:95thout=outbits,95,PERCENT"; $rrd_options .= " VDEF:d95thout=doutbits,5,PERCENT"; @@ -110,10 +110,8 @@ if(!$nototal) # $rrd_options .= " GPRINT:totin:AVERAGE:%6.2lf%s$units"; # $rrd_options .= " GPRINT:totin:MAX:%6.2lf%s$units\l"; - } - $rrd_options .= $rrd_optionsb; $rrd_options .= " HRULE:0#999999"; diff --git a/html/includes/graphs/generic_simplex.inc.php b/html/includes/graphs/generic_simplex.inc.php index d30e1f99d..b9153ebe2 100644 --- a/html/includes/graphs/generic_simplex.inc.php +++ b/html/includes/graphs/generic_simplex.inc.php @@ -1,13 +1,10 @@ = "5") { - $auth = 1; + $auth = 1; } ?> diff --git a/html/includes/graphs/global/bits.inc.php b/html/includes/graphs/global/bits.inc.php index 829a7bdc7..29af53f8d 100644 --- a/html/includes/graphs/global/bits.inc.php +++ b/html/includes/graphs/global/bits.inc.php @@ -51,7 +51,6 @@ $colours_out = 'blues'; $nototal = 1; - $ds_in = "INOCTETS"; $ds_out = "OUTOCTETS"; diff --git a/html/includes/graphs/graph.inc.php b/html/includes/graphs/graph.inc.php index 237c4ed2d..f31dc57d0 100644 --- a/html/includes/graphs/graph.inc.php +++ b/html/includes/graphs/graph.inc.php @@ -41,7 +41,7 @@ $subtype = $graphtype['subtype']; if (is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php")) { - if (isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs']) + if (isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs']) { $auth = "1"; ## hardcode auth for all with config function } @@ -52,8 +52,8 @@ if (is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.p { if (Net_IPv4::ipInNetwork($_SERVER['REMOTE_ADDR'], $range)) { - $auth = "1"; - if($debug) { echo("matched $range"); } + $auth = "1"; + if ($debug) { echo("matched $range"); } break; } } diff --git a/html/includes/graphs/munin/auth.inc.php b/html/includes/graphs/munin/auth.inc.php index b9a3faee5..cf894de65 100755 --- a/html/includes/graphs/munin/auth.inc.php +++ b/html/includes/graphs/munin/auth.inc.php @@ -1,6 +1,6 @@ '); echo('

'.generate_link(nicecase($app['app_type']),array('page'=>'apps','app'=>$app['app_type'])).'

'); $app_devices = dbFetchRows("SELECT * FROM `devices` AS D, `applications` AS A WHERE D.device_id = A.device_id AND A.app_type = ?", array($app['app_type'])); + foreach ($app_devices as $app_device) { - $graph_type = $graphs[$app['app_type']][0]; $graph_array['type'] = "application_".$app['app_type']."_".$graph_type; @@ -33,7 +33,7 @@ foreach ($app_list as $app) $overlib_url = generate_url($link_array); $overlib_link = ''.shorthost($app_device['hostname']).""; - if(!empty($app_device['app_instance'])) + if (!empty($app_device['app_instance'])) { $overlib_link .= ''.$app_device['app_instance'].""; $app_device['content_add'] = '('.$app_device['app_instance'].')'; diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index 477127290..e413eff35 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -100,7 +100,6 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) '); } - if (@dbFetchCell("SELECT COUNT(interface_id) FROM ports WHERE device_id = '" . $device['device_id'] . "'") > '0') { echo('
  • diff --git a/html/pages/device/edit/snmp.inc.php b/html/pages/device/edit/snmp.inc.php index 4f9d2d93d..dd9a44d63 100644 --- a/html/pages/device/edit/snmp.inc.php +++ b/html/pages/device/edit/snmp.inc.php @@ -20,16 +20,16 @@ if ($_POST['editing']) #FIXME needs better feedback $update = array( - 'community' => $community, - 'snmpver' => $snmpver, + 'community' => $community, + 'snmpver' => $snmpver, 'port' => $port ); - if ($_POST['timeout']) { $update['timeout'] = $timeout; } + if ($_POST['timeout']) { $update['timeout'] = $timeout; } else { $update['timeout'] = array('NULL'); } - if ($_POST['retries']) { $update['retries'] = $retries; } + if ($_POST['retries']) { $update['retries'] = $retries; } else { $update['retries'] = array('NULL'); } - + $update = array_merge($update, $v3); $rows_updated = dbUpdate($update, 'devices', '`device_id` = ?',array($device['device_id'])); diff --git a/html/pages/device/graphs.inc.php b/html/pages/device/graphs.inc.php index 72fa6ba1a..17cc8c58c 100644 --- a/html/pages/device/graphs.inc.php +++ b/html/pages/device/graphs.inc.php @@ -57,6 +57,7 @@ foreach ($graph_enable as $graph => $entry) { $graph_title = $config['graph_types']['device'][$graph]['descr']; $graph_array['type'] = "device_" . $graph; + include("includes/print-device-graph.php"); } } diff --git a/html/pages/front/globe.php b/html/pages/front/globe.php index 7c0439b64..af3260792 100644 --- a/html/pages/front/globe.php +++ b/html/pages/front/globe.php @@ -11,23 +11,23 @@ data.addRows([ 0) { $state = 0; } else { $state = 100; } + if ($down > 0) { $state = 0; } else { $state = 100; } $locations[] = "['".$location."',".$state.", '".implode(", ", $devices_down)."']"; @@ -55,11 +55,8 @@ echo(implode(",\n", $locations)); -
    - - "; } $content .= ""; - if(empty($vars['name'])) + if (empty($vars['name'])) { echo("".overlib_link("", $version, $content, NULL).""); } else { diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index f1eb09681..c61eb88ff 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -273,7 +273,6 @@ $config['nfsen_enable'] = 0; ### Use this feature to map ugly locations to pretty locations #config['location_map']['Under the Sink'] = "Under The Sink, The Office, London, UK"; - ### Ignores & Allows # Has to be lowercase diff --git a/includes/discovery/ports.inc.php b/includes/discovery/ports.inc.php index ee93e2bc2..d86b4385a 100755 --- a/includes/discovery/ports.inc.php +++ b/includes/discovery/ports.inc.php @@ -124,7 +124,7 @@ if ($debug) { print_r($port_stats); } ## -- i can make it a function, so that you don't know what it's doing. ## -- $ports_db = adamasMagicFunction($ports_db); ? -foreach(dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ?", array($device['device_id'])) as $port) +foreach (dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ?", array($device['device_id'])) as $port) { $ports_db[$port['ifIndex']] = $port; $ports_db_l[$port['ifIndex']] = $port['interface_id']; @@ -146,7 +146,7 @@ foreach ($port_stats as $ifIndex => $port) $ports_db[$ifIndex]['deleted'] = "0"; echo("U"); } else { - echo ("."); + echo("."); } /// We've seen it. Remove it from the cache. unset($ports_l[$ifIndex]); @@ -166,9 +166,9 @@ foreach ($port_stats as $ifIndex => $port) /// Interface Deletion /// If it's in our $ports_l list, that means it's not been seen. Mark it deleted. -foreach($ports_l as $ifIndex => $port_id) +foreach ($ports_l as $ifIndex => $port_id) { - if($ports_db[$ifIndex]['deleted'] == "0") + if ($ports_db[$ifIndex]['deleted'] == "0") { dbUpdate(array('deleted' => '1'), 'ports', '`interface_id` = ?', array($port_id)); echo("-".$ifIndex); diff --git a/includes/functions.php b/includes/functions.php index 929321720..6b9ac3734 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -289,7 +289,7 @@ function addHost($host, $snmpver, $port = '161', $transport = 'udp') print_error("Could not resolve $host"); } } else { /// found in database - print_error("Already got host $host"); + print_error("Already got host $host"); } return 0; } diff --git a/includes/polling/applications/nginx.inc.php b/includes/polling/applications/nginx.inc.php index b95ae0795..b41d216e0 100644 --- a/includes/polling/applications/nginx.inc.php +++ b/includes/polling/applications/nginx.inc.php @@ -28,11 +28,11 @@ rrdtool_update($nginx_rrd, "N:$req:$active:$reading:$writing:$waiting"); /// Unset the variables we set here -unset($nginx); -unset($nginx_rrd); -unset($active); -unset($reading); -unset($writing); +unset($nginx); +unset($nginx_rrd); +unset($active); +unset($reading); +unset($writing); unset($req); ?> diff --git a/includes/polling/system.inc.php b/includes/polling/system.inc.php index 23b1dc26d..91f98e425 100755 --- a/includes/polling/system.inc.php +++ b/includes/polling/system.inc.php @@ -84,7 +84,7 @@ $poll_device['sysLocation'] = str_replace("\"","", $poll_device['sysLocation']); /// Rewrite sysLocation if there is a mapping array (database too?) - if(!empty($poll_device['sysLocation']) && is_array($config['location_map'])) + if (!empty($poll_device['sysLocation']) && is_array($config['location_map'])) { $poll_device['sysLocation'] = rewrite_location($poll_device['sysLocation']); } diff --git a/includes/rewrites.php b/includes/rewrites.php index 38e6b7ffb..a7a41cd88 100644 --- a/includes/rewrites.php +++ b/includes/rewrites.php @@ -1,24 +1,22 @@ /dev/null"; } $data = trim(external_exec($cmd)); @@ -150,7 +150,7 @@ function snmp_walk($device, $oid, $options = NULL, $mib = NULL, $mibdir = NULL) { $snmpcommand = $config['snmpbulkwalk']; } - + $cmd = $snmpcommand; $cmd .= snmp_gen_auth ($device); @@ -217,7 +217,7 @@ function snmpwalk_cache_cip($device, $oid, $array, $mib = 0) $cmd = $snmpcommand; $cmd .= snmp_gen_auth ($device); - $cmd .= " -O snQ"; + $cmd .= " -O snQ"; if ($mib) { $cmd .= " -m $mib"; } $cmd .= " -M ".$config['install_dir']."/mibs"; if (isset($timeout)) { $cmd .= " -t " . $timeout; } @@ -286,7 +286,7 @@ function snmp_cache_ifIndex($device) $cmd = $snmpcommand; $cmd .= snmp_gen_auth ($device); - $cmd .= " -O Qs"; + $cmd .= " -O Qs"; $cmd .= " -M " . $config['install_dir']."/mibs"; $cmd .= " -m IF-MIB ifIndex"; @@ -552,7 +552,7 @@ function snmp_cache_slotport_oid($oid, $device, $array, $mib = 0) $cmd = $snmpcommand; $cmd .= snmp_gen_auth ($device); - $cmd .= " -O QUs"; + $cmd .= " -O QUs"; if ($mib) { $cmd .= " -m $mib"; } $cmd .= " -M ".$config['install_dir']."/mibs"; if (isset($timeout)) { $cmd .= " -t " . $timeout; } @@ -614,7 +614,7 @@ function snmp_cache_port_oids($oids, $port, $device, $array, $mib=0) $cmd = $config['snmpget']; $cmd .= snmp_gen_auth ($device); - $cmd .= " -O vq"; + $cmd .= " -O vq"; if (isset($timeout)) { $cmd .= " -t " . $timeout; } if (isset($retries)) { $cmd .= " -r " . $retries; } $cmd .= " -M ".$config['install_dir']."/mibs"; @@ -663,7 +663,7 @@ function snmp_cache_portIfIndex($device, $array) $cmd = $config['snmpwalk']; $cmd .= snmp_gen_auth ($device); - $cmd .= " -CI -m CISCO-STACK-MIB -O q"; + $cmd .= " -CI -m CISCO-STACK-MIB -O q"; $cmd .= " -M ".$config['install_dir']."/mibs"; if (isset($timeout)) { $cmd .= " -t " . $timeout; } if (isset($retries)) { $cmd .= " -r " . $retries; } @@ -710,7 +710,7 @@ function snmp_cache_portName($device, $array) $cmd = $config['snmpwalk']; $cmd .= snmp_gen_auth ($device); - $cmd .= " -CI -m CISCO-STACK-MIB -O Qs"; + $cmd .= " -CI -m CISCO-STACK-MIB -O Qs"; $cmd .= " -M ".$config['install_dir']."/mibs"; if (isset($timeout)) { $cmd .= " -t " . $timeout; } if (isset($retries)) { $cmd .= " -r " . $retries; }