diff options
author | Scott Ullrich <sullrich@gmail.com> | 2012-05-10 08:05:55 -0700 |
---|---|---|
committer | Scott Ullrich <sullrich@gmail.com> | 2012-05-10 08:05:55 -0700 |
commit | d016784d0d0b652168500825ea1cade961c7eef6 (patch) | |
tree | 2feb475a8d99cf7d74f70ebe207e8f5ffad568db /config/lightsquid | |
parent | f6e9bacbf90fe247a2a5e909ef98f880b2f09339 (diff) | |
parent | 49d604126f311966c2e61e125064191142bd98e8 (diff) | |
download | pfsense-packages-d016784d0d0b652168500825ea1cade961c7eef6.tar.gz pfsense-packages-d016784d0d0b652168500825ea1cade961c7eef6.tar.bz2 pfsense-packages-d016784d0d0b652168500825ea1cade961c7eef6.zip |
Merge pull request #244 from dvserg/master
Lightsquid + SQStat mon
Diffstat (limited to 'config/lightsquid')
-rw-r--r-- | config/lightsquid/lightsquid.inc | 29 | ||||
-rw-r--r-- | config/lightsquid/lightsquid.xml | 26 |
2 files changed, 52 insertions, 3 deletions
diff --git a/config/lightsquid/lightsquid.inc b/config/lightsquid/lightsquid.inc index 0519c196..0825f0c1 100644 --- a/config/lightsquid/lightsquid.inc +++ b/config/lightsquid/lightsquid.inc @@ -258,8 +258,22 @@ function lightsquid_resync() { // update squid conf if (isset($config['installedpackages']['squid']['config'][0])) { - $config['installedpackages']['squid']['config'][0]['log_enabled'] = 'on'; - $config['installedpackages']['squid']['config'][0]['log_dir'] = LS_SQUIDLOGPATH; + $squid_settings = $config['installedpackages']['squid']['config'][0]; + $squid_settings['log_enabled'] = 'on'; + $squid_settings['log_dir'] = LS_SQUIDLOGPATH; + + # sqstat + $ifmgr = "127.0.0.1;"; + $iface = ($squid_settings['active_interface'] ? $squid_settings['active_interface'] : 'lan'); + $iface = explode(",", $iface); + foreach ($iface as $i => $if) { + $realif = ls_get_real_interface_address($if); + if ($realif[0]) + $ifmgr = $ifmgr . $realif[0] . ";"; + } + + $config['installedpackages']['squidcache']['config'][0]['ext_cachemanager'] = $ifmgr; + write_config(); squid_resync(); } @@ -384,4 +398,15 @@ function refresh_full() { update_log("refresh_full: stop"); } +function ls_get_real_interface_address($iface) +{ + global $config; + + $iface = convert_friendly_interface_to_real_interface_name($iface); + $line = trim(shell_exec("ifconfig $iface | grep inet | grep -v inet6")); + list($dummy, $ip, $dummy2, $netmask) = explode(" ", $line); + + return array($ip, long2ip(hexdec($netmask))); +} + ?>
\ No newline at end of file diff --git a/config/lightsquid/lightsquid.xml b/config/lightsquid/lightsquid.xml index cb481943..b8ce2bc8 100644 --- a/config/lightsquid/lightsquid.xml +++ b/config/lightsquid/lightsquid.xml @@ -47,7 +47,7 @@ <faq>Currently there are no FAQ items provided.</faq> <name>lightsquid</name> <version>1.7.1</version> - <title>Services: Proxy server Report(LightSquid) -> Settings</title> + <title>Services: Proxy Reports (LightSquid, SQStat) -> Settings</title> <category>Status</category> <include_file>/usr/local/pkg/lightsquid.inc</include_file> <menu> @@ -66,6 +66,10 @@ <text>Lightsquid Report</text> <url>/lightsquid/index.cgi</url> </tab> + <tab> + <text>Proxy State</text> + <url>/sqstat/sqstat.php</url> + </tab> </tabs> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> @@ -77,6 +81,26 @@ <chmod>0755</chmod> <item>http://files.pfsense.org/packages/All/lightsquid_tpl.tbz</item> </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/www/sqstat/</prefix> + <chmod>0644</chmod> + <item>http://www.pfsense.org/packages/config/lightsquid/sqstat.class.php</item> + </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/www/sqstat/</prefix> + <chmod>0644</chmod> + <item>http://www.pfsense.org/packages/config/lightsquid/sqstat.php</item> + </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/www/sqstat/</prefix> + <chmod>0644</chmod> + <item>http://www.pfsense.org/packages/config/lightsquid/sqstat.css</item> + </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/www/sqstat/</prefix> + <chmod>0644</chmod> + <item>http://www.pfsense.org/packages/config/lightsquid/zhabascript.js</item> + </additional_files_needed> <fields> <field> <fielddescr>Language</fielddescr> |