From: <abe...@us...> - 2012-01-19 18:15:30
|
Revision: 5396 http://astlinux.svn.sourceforge.net/astlinux/?rev=5396&view=rev Author: abelbeck Date: 2012-01-19 18:15:24 +0000 (Thu, 19 Jan 2012) Log Message: ----------- webinterface, Status tab, DAHDI Status can display Sangoma status commands 'wanrouter status' or 'wanrouter summary' if defined in Prefs tab -> DAHDI Status Command Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2012-01-18 23:47:06 UTC (rev 5395) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2012-01-19 18:15:24 UTC (rev 5396) @@ -877,7 +877,11 @@ putHtml("<h2>DAHDI Status:</h2>"); putHtml("<pre>"); $tmpfile = tempnam("/tmp", "PHP_"); - asteriskCMD($cmd, $tmpfile); + if ($cmd === 'wanrouter status' || $cmd === 'wanrouter summary') { + shell('/usr/sbin/'.$cmd.' >'.$tmpfile, $ret_status); + } else { + asteriskCMD($cmd, $tmpfile); + } $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { if ($line = trim(fgets($ph, 1024))) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-06-19 18:20:37
|
Revision: 6556 http://sourceforge.net/p/astlinux/code/6556 Author: abelbeck Date: 2014-06-19 18:20:33 +0000 (Thu, 19 Jun 2014) Log Message: ----------- web interface, Status tab, Zabbix Monitoring Status, properly match processes with Zabbix 2.2.x Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2014-06-19 17:36:03 UTC (rev 6555) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2014-06-19 18:20:33 UTC (rev 6556) @@ -102,9 +102,9 @@ $status['pptpd']++; } elseif (strpos($line, ' upsmon') !== FALSE || strpos($line, '/upsmon') !== FALSE) { $status['upsmon']++; - } elseif (strpos($line, ' zabbix_agentd ') !== FALSE || strpos($line, '/zabbix_agentd ') !== FALSE) { + } elseif (strpos($line, ' zabbix_agentd ') !== FALSE || strpos($line, ' zabbix_agentd: ') !== FALSE) { $status['zabbix_agentd']++; - } elseif (strpos($line, ' zabbix_proxy ') !== FALSE || strpos($line, '/zabbix_proxy ') !== FALSE) { + } elseif (strpos($line, ' zabbix_proxy ') !== FALSE || strpos($line, ' zabbix_proxy: ') !== FALSE) { $status['zabbix_proxy']++; } elseif (strpos($line, 'reboot -d') !== FALSE) { $status['reboot']++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-07-02 22:15:16
|
Revision: 6579 http://sourceforge.net/p/astlinux/code/6579 Author: abelbeck Date: 2014-07-02 22:15:08 +0000 (Wed, 02 Jul 2014) Log Message: ----------- web interface, Status tab, add 'Show PPPoE Logs' button to display filtered pppd logs Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2014-07-02 17:56:21 UTC (rev 6578) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2014-07-02 22:15:08 UTC (rev 6579) @@ -31,6 +31,7 @@ // 09-28-2012, Added Custom Asterisk Command // 01-20-2013, Added XMPP Server Status // 01-03-2014, Added NUT UPS Monitoring Status +// 07-02-2014, Added "Show PPPoE Logs" button // // System location of OpenVPN Client logfile $OVPNCLOGFILE = '/var/log/openvpnclient-status.log'; @@ -465,6 +466,9 @@ $result = 1; if (isset($_POST['submit_pppoe'])) { $result = restartPROCESS('pppoe', 10, 99); + } elseif (isset($_POST['show_pppoe_logs'])) { + header('Location: '.$myself.'?show_pppoe_logs'); + exit; } header('Location: '.$myself.'?result='.$result); exit; @@ -614,6 +618,9 @@ putHtml('<form method="post" action="'.$myself.'">'); putHtml("<h2>PPPoE Connection Status:"); putHtml('<input type="submit" value="Restart PPPoE" name="submit_pppoe" />'); + if (! isset($_GET['show_pppoe_logs'])) { + putHtml('<input type="submit" value="Show PPPoE Logs" name="show_pppoe_logs" />'); + } putHtml("</h2>"); putHtml("</form>"); putHtml("<pre>"); @@ -630,6 +637,23 @@ } else { putText('No pppoe-status available.'); } + if (isset($_GET['show_pppoe_logs'])) { + putText(''); + putText('Recent PPPoE Logs:'); + putText('=================='); + $cmd = 'grep -e "pppd\[[0-9]*]:" /var/log/messages'; + $cmd .= ' | grep -v -i -e "pado packets" -e "pppoe discovery"'; + $cmd .= ' | tail -n 30'; + shell($cmd.' >'.$tmpfile, $status); + + $ph = @fopen($tmpfile, "r"); + while (! feof($ph)) { + if ($line = trim(fgets($ph, 1024))) { + putText($line); + } + } + fclose($ph); + } @unlink($tmpfile); putHtml("</pre>"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-08-27 14:35:03
|
Revision: 6673 http://sourceforge.net/p/astlinux/code/6673 Author: abelbeck Date: 2014-08-27 14:34:56 +0000 (Wed, 27 Aug 2014) Log Message: ----------- web interface, Status tab, rewrite getDaemons() function to more accurately determine active processes, ie. don't match 'asterisk' when it is used as an argument, and is much simplier Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2014-08-27 14:30:10 UTC (rev 6672) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2014-08-27 14:34:56 UTC (rev 6673) @@ -67,6 +67,7 @@ // Find running daemons // function getDaemons() { + $status['asterisk'] = 0; $status['ntpd'] = 0; $status['miniupnpd'] = 0; @@ -79,42 +80,18 @@ $status['zabbix_agentd'] = 0; $status['zabbix_proxy'] = 0; $status['reboot'] = 0; - - $tmpfile = tempnam("/tmp", "PHP_"); - @exec('ps >'.$tmpfile); - $ph = @fopen($tmpfile, "r"); - while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { - if (strpos($line, ' asterisk') !== FALSE || strpos($line, '/asterisk') !== FALSE) { - $status['asterisk']++; - } elseif (strpos($line, ' ntpd') !== FALSE || strpos($line, '/ntpd') !== FALSE) { - $status['ntpd']++; - } elseif (strpos($line, ' miniupnpd') !== FALSE || strpos($line, '/miniupnpd') !== FALSE) { - $status['miniupnpd']++; - } elseif (strpos($line, ' dnsmasq') !== FALSE || strpos($line, '/dnsmasq') !== FALSE) { - $status['dnsmasq']++; - } elseif (strpos($line, ' syslogd') !== FALSE || strpos($line, '/syslogd') !== FALSE) { - $status['syslogd']++; - } elseif (strpos($line, ' openvpn') !== FALSE || strpos($line, '/openvpn') !== FALSE) { - $status['openvpn']++; - } elseif (strpos($line, ' racoon') !== FALSE || strpos($line, '/racoon') !== FALSE) { - $status['racoon']++; - } elseif (strpos($line, ' pptpd') !== FALSE || strpos($line, '/pptpd') !== FALSE) { - $status['pptpd']++; - } elseif (strpos($line, ' upsmon') !== FALSE || strpos($line, '/upsmon') !== FALSE) { - $status['upsmon']++; - } elseif (strpos($line, ' zabbix_agentd ') !== FALSE || strpos($line, ' zabbix_agentd: ') !== FALSE) { - $status['zabbix_agentd']++; - } elseif (strpos($line, ' zabbix_proxy ') !== FALSE || strpos($line, ' zabbix_proxy: ') !== FALSE) { - $status['zabbix_proxy']++; - } elseif (strpos($line, 'reboot -d') !== FALSE) { - $status['reboot']++; + + $output = array(); + @exec('ps -o comm=""', $output); + + foreach ($output as $line) { + foreach ($status as $key => $value) { + if ($key === $line) { + $status["$key"]++; + break; } } } - fclose($ph); - @unlink($tmpfile); - return($status); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-01-27 00:36:12
|
Revision: 6948 http://sourceforge.net/p/astlinux/code/6948 Author: abelbeck Date: 2015-01-27 00:36:08 +0000 (Tue, 27 Jan 2015) Log Message: ----------- web interface, Status tab, refine 'Firewall States' to be more efficient and look at more states if available Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2015-01-26 13:48:45 UTC (rev 6947) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2015-01-27 00:36:08 UTC (rev 6948) @@ -1,6 +1,6 @@ <?php -// Copyright (C) 2008-2014 Lonnie Abelbeck +// Copyright (C) 2008-2015 Lonnie Abelbeck // This is free software, licensed under the GNU General Public License // version 3 as published by the Free Software Foundation; you can // redistribute it and/or modify it under the terms of the GNU @@ -165,7 +165,7 @@ // Function: parseFIREWALLstates // -function parseFIREWALLstates(&$status, $log) { +function parseFIREWALLstates(&$status, $log, $max) { global $global_prefs; $proto = array ( @@ -233,6 +233,8 @@ } $unique = TRUE; + $xid = $max; + $xbytes = $bytes; for ($i = 0; $i < $cid; $i++) { if ($status['states'][$i]['src'] === $src && $status['states'][$i]['dst'] === $dst && @@ -248,19 +250,34 @@ } $unique = FALSE; break; + } elseif ($status['states'][$i]['bytes'] < $xbytes) { + $xid = $i; + $xbytes = $status['states'][$i]['bytes']; } } if ($unique) { - $status['states'][$cid]['bytes'] = $bytes; - $status['states'][$cid]['packets'] = $packets; - $status['states'][$cid]['src'] = $src; - $status['states'][$cid]['sport'] = $sport; - $status['states'][$cid]['nsports'] = 1; - $status['states'][$cid]['dst'] = $dst; - $status['states'][$cid]['dport'] = $dport; - $status['states'][$cid]['proto'] = $protocol; - $status['states'][$cid]['ttl'] = $ttl; - $cid++; + if ($cid < $max) { + $status['states'][$cid]['bytes'] = $bytes; + $status['states'][$cid]['packets'] = $packets; + $status['states'][$cid]['src'] = $src; + $status['states'][$cid]['sport'] = $sport; + $status['states'][$cid]['nsports'] = 1; + $status['states'][$cid]['dst'] = $dst; + $status['states'][$cid]['dport'] = $dport; + $status['states'][$cid]['proto'] = $protocol; + $status['states'][$cid]['ttl'] = $ttl; + $cid++; + } elseif ($xid < $max) { + $status['states'][$xid]['bytes'] = $bytes; + $status['states'][$xid]['packets'] = $packets; + $status['states'][$xid]['src'] = $src; + $status['states'][$xid]['sport'] = $sport; + $status['states'][$xid]['nsports'] = 1; + $status['states'][$xid]['dst'] = $dst; + $status['states'][$xid]['dport'] = $dport; + $status['states'][$xid]['proto'] = $protocol; + $status['states'][$xid]['ttl'] = $ttl; + } } } } @@ -1137,9 +1154,9 @@ if (getPREFdef($global_prefs, 'status_show_firewall_states') === 'yes') { putHtml("<h2>Firewall States:</h2>"); $tmpfile = tempnam("/tmp", "PHP_"); - shell('grep -v "127\.0\.0\.1" '.$CONNTRACK.' | tail -n 500 >'.$tmpfile, $status); + shell('grep -v "127\.0\.0\.1" '.$CONNTRACK.' | head -n 2500 >'.$tmpfile, $status); - parseFIREWALLstates($firewall, $tmpfile); + parseFIREWALLstates($firewall, $tmpfile, 100); if (is_null($firewall)) { putHtml("<pre>"); putText('No Active Firewall States'); @@ -1147,7 +1164,7 @@ } else { putHtml('<pre><table class="statusdatatable">'); putHtml("<tr>"); - if (($n = min(count($firewall['states']), 100)) > 0) { + if (($n = count($firewall['states'])) > 0) { echo "<td>", "Source", "</td>"; echo "<td>", "Port (#'s)", "</td>"; echo "<td>", "Destination", "</td>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-11-28 15:56:46
|
Revision: 7354 http://sourceforge.net/p/astlinux/code/7354 Author: abelbeck Date: 2015-11-28 15:56:43 +0000 (Sat, 28 Nov 2015) Log Message: ----------- web interface, Status tab, add system architecture string to 'AstLinux Release:' Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2015-11-25 16:03:05 UTC (rev 7353) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2015-11-28 15:56:43 UTC (rev 7354) @@ -572,7 +572,7 @@ echo '<td style="text-align: left;">'; if (($fp = @fopen('/etc/astlinux-release', 'r')) !== FALSE) { if (! feof($fp)) { - $line = trim(fgets($fp, 1024)); + $line = trim(fgets($fp, 1024)).' '.trim(shell_exec('uname -m')); if ($daemon['asterisk'] > 0) { $line .= ' - '.trim(shell_exec('/usr/sbin/asterisk -V')); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-12-07 18:36:59
|
Revision: 7381 http://sourceforge.net/p/astlinux/code/7381 Author: abelbeck Date: 2015-12-07 18:36:57 +0000 (Mon, 07 Dec 2015) Log Message: ----------- web interface, Status tab, allow empty lines within a Custom Asterisk Command output Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2015-12-07 17:29:04 UTC (rev 7380) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2015-12-07 18:36:57 UTC (rev 7381) @@ -1066,10 +1066,22 @@ $tmpfile = tempnam("/tmp", "PHP_"); asteriskCMD($cmd, $tmpfile); $ph = @fopen($tmpfile, "r"); + $valid_line = FALSE; + $empty_lines = 0; while (! feof($ph)) { - if (($line = trim(fgets($ph, 1024))) !== '') { - if (strncasecmp($line, 'verbosity ', 10)) { + $line = trim(fgets($ph, 1024)); + if (strncasecmp($line, 'verbosity ', 10)) { + if ($line !== '') { + if ($valid_line) { + while ($empty_lines > 0) { + putText(''); + $empty_lines--; + } + } putText($line); + $valid_line = TRUE; + } else { + $empty_lines++; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-12-23 16:22:35
|
Revision: 7425 http://sourceforge.net/p/astlinux/code/7425 Author: abelbeck Date: 2015-12-23 16:22:33 +0000 (Wed, 23 Dec 2015) Log Message: ----------- web interface, Status tab, display number of active DHCP leases Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2015-12-22 18:26:09 UTC (rev 7424) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2015-12-23 16:22:33 UTC (rev 7425) @@ -790,6 +790,8 @@ echo "<td>", htmlspecialchars(mac2vendor($dhcp['clients'][$i]['mac'])), "</td>"; } } + putHtml("</tr><tr>"); + echo '<td colspan="5">'.$n.' Active DHCP Leases</td>'; } putHtml("</tr>"); putHtml("</table></pre>"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-12-24 18:26:59
|
Revision: 7426 http://sourceforge.net/p/astlinux/code/7426 Author: abelbeck Date: 2015-12-24 18:26:57 +0000 (Thu, 24 Dec 2015) Log Message: ----------- web interface, Status tab, display number of Total Firewall States Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2015-12-23 16:22:33 UTC (rev 7425) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2015-12-24 18:26:57 UTC (rev 7426) @@ -1176,6 +1176,9 @@ putText('No Active Firewall States'); putHtml("</pre>"); } else { + if (($total_firewall_states = trim(@file_get_contents('/proc/sys/net/netfilter/nf_conntrack_count'))) === '') { + $total_firewall_states = 'Unknown'; + } putHtml('<pre><table class="statusdatatable">'); putHtml("<tr>"); if (($n = count($firewall['states'])) > 0) { @@ -1198,6 +1201,8 @@ echo "<td>", $firewall['states'][$i]['bytes'], "</td>"; echo '<td style="text-align: right;">', secs2minsec($firewall['states'][$i]['ttl']), "</td>"; } + putHtml("</tr><tr>"); + echo '<td colspan="8">'.$total_firewall_states.' Total Firewall States</td>'; } putHtml("</tr>"); putHtml("</table></pre>"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-12-24 21:42:06
|
Revision: 7427 http://sourceforge.net/p/astlinux/code/7427 Author: abelbeck Date: 2015-12-24 21:42:04 +0000 (Thu, 24 Dec 2015) Log Message: ----------- web interface, Status tab, Firewall States, change order of 'head' and 'grep' so all of /proc/net/nf_conntrack does not have to be indexed. Can be slightly less overall output but faster for a very large number of states Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2015-12-24 18:26:57 UTC (rev 7426) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2015-12-24 21:42:04 UTC (rev 7427) @@ -1168,7 +1168,7 @@ if (getPREFdef($global_prefs, 'status_show_firewall_states') === 'yes') { putHtml("<h2>Firewall States:</h2>"); $tmpfile = tempnam("/tmp", "PHP_"); - shell('grep -v "127\.0\.0\.1" '.$CONNTRACK.' | head -n 2500 >'.$tmpfile, $status); + shell('head -n 2500 '.$CONNTRACK.' | grep -v "127\.0\.0\.1" >'.$tmpfile, $status); parseFIREWALLstates($firewall, $tmpfile, 100); if (is_null($firewall)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |