diff options
author | jim-p <jimp@pfsense.org> | 2012-07-05 13:57:14 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-07-05 13:57:14 -0400 |
commit | 7e69acd64c9d39de18d8edd60661e5bbda3c4764 (patch) | |
tree | d531366764ebd9a04fa658fd352fa2df350be0e6 /config/zabbix-proxy | |
parent | df3bd743e2cfa5026da65fe5b2ee5222f9729da4 (diff) | |
download | pfsense-packages-7e69acd64c9d39de18d8edd60661e5bbda3c4764.tar.gz pfsense-packages-7e69acd64c9d39de18d8edd60661e5bbda3c4764.tar.bz2 pfsense-packages-7e69acd64c9d39de18d8edd60661e5bbda3c4764.zip |
whitespace cleanup
Diffstat (limited to 'config/zabbix-proxy')
-rw-r--r-- | config/zabbix-proxy/zabbix-proxy.xml | 365 |
1 files changed, 182 insertions, 183 deletions
diff --git a/config/zabbix-proxy/zabbix-proxy.xml b/config/zabbix-proxy/zabbix-proxy.xml index fce266c6..551c42b5 100644 --- a/config/zabbix-proxy/zabbix-proxy.xml +++ b/config/zabbix-proxy/zabbix-proxy.xml @@ -1,120 +1,120 @@ <?xml version="1.0" encoding="utf-8"?> <packagegui> - <name>zabbixproxy</name> - <title>Services: Zabbix Proxy</title> - <category>Monitoring</category> - <version>1.01</version> - <addedit_string>Zabbix Proxy has been created/modified.</addedit_string> - <delete_string>Zabbix Proxy has been deleted.</delete_string> - <restart_command>/usr/local/etc/rc.d/zabbix_proxy.sh restart</restart_command> - <menu> - <name>Zabbix Proxy</name> - <tooltiptext>Setup Zabbix Proxy specific settings</tooltiptext> - <section>Services</section> - <url>/pkg_edit.php?xml=zabbix-proxy.xml&id=0</url> - </menu> - <service> - <name>zabbix-proxy</name> - <rcfile>zabbix-proxy.sh</rcfile> - <executable>zabbix_proxy</executable> - </service> - <tabs> - <tab> - <text>Settings</text> - <url>/pkg_edit.php?xml=zabbix-proxy.xml&id=0</url> - <active /> - </tab> - </tabs> - <fields> - <field> - <fielddescr>Server</fielddescr> - <fieldname>server</fieldname> - <description>List of comma delimited IP addresses (or hostnames) of ZABBIX servers</description> - <default_value>127.0.0.1</default_value> - <type>input</type> - <size>100</size> - <required>true</required> - </field> - <field> - <fielddescr>Server Port</fielddescr> - <fieldname>serverport</fieldname> - <description>Server port (generally 10051)</description> - <default_value>10051</default_value> - <type>input</type> - <size>6</size> - <required>true</required> - </field> - <field> - <fielddescr>Hostname</fielddescr> - <fieldname>hostname</fieldname> - <description>Unique, case-sensitive proxy name. Make sure the proxy name is known to the server</description> - <default_value>localhost</default_value> - <type>input</type> - <size>100</size> - <required>true</required> - </field> - <field> - <fielddescr>Active Mode</fielddescr> - <fieldname>activemode</fieldname> - <description>Check to run Zabbix proxy in active mode (default)</description> - <default_value>on</default_value> - <type>checkbox</type> - <required>true</required> - </field> - <field> - <fielddescr>Config Frequency</fielddescr> - <fieldname>configfrequency</fieldname> - <description>How often the proxy retrieves configuration data from the Zabbix server in seconds. Ignored if the proxy runs in passive mode.</description> - <default_value>3600</default_value> - <type>input</type> - <size>10</size> - <required>true</required> - </field> - </fields> + <name>zabbixproxy</name> + <title>Services: Zabbix Proxy</title> + <category>Monitoring</category> + <version>1.01</version> + <addedit_string>Zabbix Proxy has been created/modified.</addedit_string> + <delete_string>Zabbix Proxy has been deleted.</delete_string> + <restart_command>/usr/local/etc/rc.d/zabbix_proxy.sh restart</restart_command> + <menu> + <name>Zabbix Proxy</name> + <tooltiptext>Setup Zabbix Proxy specific settings</tooltiptext> + <section>Services</section> + <url>/pkg_edit.php?xml=zabbix-proxy.xml&id=0</url> + </menu> + <service> + <name>zabbix-proxy</name> + <rcfile>zabbix-proxy.sh</rcfile> + <executable>zabbix_proxy</executable> + </service> + <tabs> + <tab> + <text>Settings</text> + <url>/pkg_edit.php?xml=zabbix-proxy.xml&id=0</url> + <active /> + </tab> + </tabs> + <fields> + <field> + <fielddescr>Server</fielddescr> + <fieldname>server</fieldname> + <description>List of comma delimited IP addresses (or hostnames) of ZABBIX servers</description> + <default_value>127.0.0.1</default_value> + <type>input</type> + <size>100</size> + <required>true</required> + </field> + <field> + <fielddescr>Server Port</fielddescr> + <fieldname>serverport</fieldname> + <description>Server port (generally 10051)</description> + <default_value>10051</default_value> + <type>input</type> + <size>6</size> + <required>true</required> + </field> + <field> + <fielddescr>Hostname</fielddescr> + <fieldname>hostname</fieldname> + <description>Unique, case-sensitive proxy name. Make sure the proxy name is known to the server</description> + <default_value>localhost</default_value> + <type>input</type> + <size>100</size> + <required>true</required> + </field> + <field> + <fielddescr>Active Mode</fielddescr> + <fieldname>activemode</fieldname> + <description>Check to run Zabbix proxy in active mode (default)</description> + <default_value>on</default_value> + <type>checkbox</type> + <required>true</required> + </field> + <field> + <fielddescr>Config Frequency</fielddescr> + <fieldname>configfrequency</fieldname> + <description>How often the proxy retrieves configuration data from the Zabbix server in seconds. Ignored if the proxy runs in passive mode.</description> + <default_value>3600</default_value> + <type>input</type> + <size>10</size> + <required>true</required> + </field> + </fields> <custom_php_install_command> <![CDATA[ - global $config, $g; + global $config, $g; - mwexec("mkdir -p /var/log/zabbix/"); - mwexec("mkdir -p /var/run/zabbix/"); - mwexec("mkdir -p /var/db/zabbix/"); + mwexec("mkdir -p /var/log/zabbix/"); + mwexec("mkdir -p /var/run/zabbix/"); + mwexec("mkdir -p /var/db/zabbix/"); - conf_mount_rw(); + conf_mount_rw(); - /* create a few directories and ensure the sample files are in place */ - exec("/bin/mkdir -p /usr/local/etc/zabbix"); - exec("/bin/mkdir -p /var/log/zabbix"); - exec("/bin/mkdir -p /var/run/zabbix"); - exec("/bin/mkdir -p /var/db/zabbix"); + /* create a few directories and ensure the sample files are in place */ + exec("/bin/mkdir -p /usr/local/etc/zabbix"); + exec("/bin/mkdir -p /var/log/zabbix"); + exec("/bin/mkdir -p /var/run/zabbix"); + exec("/bin/mkdir -p /var/db/zabbix"); - exec("/bin/rm -f /usr/local/etc/rc.d/zabbix_proxy"); + exec("/bin/rm -f /usr/local/etc/rc.d/zabbix_proxy"); - $start = "/bin/mkdir -p /var/log/zabbix\n"; - $start .= "/usr/sbin/chown -R zabbix:zabbix /var/log/zabbix\n"; + $start = "/bin/mkdir -p /var/log/zabbix\n"; + $start .= "/usr/sbin/chown -R zabbix:zabbix /var/log/zabbix\n"; - $start .= "/bin/mkdir -p /var/run/zabbix\n"; - $start .= "/usr/sbin/chown -R zabbix:zabbix /var/run/zabbix\n"; + $start .= "/bin/mkdir -p /var/run/zabbix\n"; + $start .= "/usr/sbin/chown -R zabbix:zabbix /var/run/zabbix\n"; - $start .= "/bin/mkdir -p /var/db/zabbix\n"; - $start .= "/usr/sbin/chown -R zabbix:zabbix /var/db/zabbix\n"; + $start .= "/bin/mkdir -p /var/db/zabbix\n"; + $start .= "/usr/sbin/chown -R zabbix:zabbix /var/db/zabbix\n"; - $start .= "echo \"Starting Zabbix Proxy\"...\n"; + $start .= "echo \"Starting Zabbix Proxy\"...\n"; - /* start zabbix proxy */ - $start .= "/usr/local/sbin/zabbix_proxy\n"; + /* start zabbix proxy */ + $start .= "/usr/local/sbin/zabbix_proxy\n"; - $stop = "echo \"Stopping Zabbix Proxy\"\n"; - $stop .= "kill `cat /var/run/zabbix/zabbix_proxy.pid`\n"; - /* write out rc.d start/stop file */ - write_rcfile(array( - "file" => "zabbix_proxy.sh", - "start" => "{$start}", - "restart" => "$stop\n" . "sleep 5\n" . "{$start}", - "stop" => "$stop" - ) - ); + $stop = "echo \"Stopping Zabbix Proxy\"\n"; + $stop .= "kill `cat /var/run/zabbix/zabbix_proxy.pid`\n"; + /* write out rc.d start/stop file */ + write_rcfile(array( + "file" => "zabbix_proxy.sh", + "start" => "{$start}", + "restart" => "$stop\n" . "sleep 5\n" . "{$start}", + "stop" => "$stop" + ) + ); - conf_mount_ro(); + conf_mount_ro(); ]]> </custom_php_install_command> <custom_php_command_before_form></custom_php_command_before_form> @@ -133,98 +133,97 @@ if (!preg_match("/^\d+$/", $ConfigFrequency)) { $input_errors[]='Config Frequency is not numeric.'; } - ]]> + ]]> </custom_php_validation_command> <custom_add_php_command></custom_add_php_command> <custom_php_resync_config_command> - <![CDATA[ - conf_mount_rw(); - global $config; - global $g; - $zabbixproxy_config = $config['installedpackages']['zabbixproxy']['config'][0]; - - $Server=$zabbixproxy_config['server']; - $ServerPort=$zabbixproxy_config['serverport']; - $Hostname=$zabbixproxy_config['hostname']; - $ListenPort=$zabbixproxy_config['listenport']; - $ConfigFrequency=$zabbixproxy_config['configfrequency']; - if(isset($zabbixproxy_config['activemode'])) { - $Mode="0"; /* active */ - } else { - $Mode="1"; /* passive */ - } - + <![CDATA[ + conf_mount_rw(); + global $config; + global $g; + $zabbixproxy_config = $config['installedpackages']['zabbixproxy']['config'][0]; + + $Server=$zabbixproxy_config['server']; + $ServerPort=$zabbixproxy_config['serverport']; + $Hostname=$zabbixproxy_config['hostname']; + $ListenPort=$zabbixproxy_config['listenport']; + $ConfigFrequency=$zabbixproxy_config['configfrequency']; + if(isset($zabbixproxy_config['activemode'])) { + $Mode="0"; /* active */ + } else { + $Mode="1"; /* passive */ + } - $conf = "Server=$Server\n"; - $conf .= "ServerPort=$ServerPort\n"; - $conf .= "Hostname=$Hostname\n"; - $conf .= "PidFile=/var/run/zabbix/zabbix_proxy.pid\n"; - $conf .= "DBName=/var/db/zabbix/proxy.db\n"; - $conf .= "LogFile=/var/log/zabbix/zabbix_proxy.log\n"; - $conf .= "ConfigFrequency=$ConfigFrequency\n"; - $conf .= "FpingLocation=/usr/local/sbin/fping\n"; - /* there's currently no fping6 (IPv6) dependency in the package, but if there was, the binary would likely also be in /usr/local/sbin */ - $conf .= "Fping6Location=/usr/local/sbin/fping6\n"; - $conf .= "ProxyMode=$Mode\n"; - - file_put_contents("/usr/local/etc/zabbix/zabbix_proxy.conf", $conf); - - $want_sysctls = array( - 'kern.ipc.shmall' => '2097152', - 'kern.ipc.shmmax' => '2147483648', - 'kern.ipc.semmsl' => '250' - ); - $sysctls = array(); - if (file_exists("/etc/sysctl.conf")) { - $sc = file_get_contents("/etc/sysctl.conf"); - $sc = explode("\n", $sc); - foreach ($sc as $num => $line) { - list($sysctl, $val) = explode("=", $line, 2); - if (array_key_exists($sysctl, $want_sysctls) || empty($sysctl)) - unset($sc[$num]); - } - } - foreach ($want_sysctls as $ws => $wv) { - $sc[] = "{$ws}={$wv}"; - exec("/sbin/sysctl {$ws}={$wv}"); - } - file_put_contents("/etc/sysctl.conf", implode("\n", $sc) . "\n"); - - $want_tunables = array( - 'kern.ipc.semopm' => '100', - 'kern.ipc.semmni' => '128', - 'kern.ipc.semmns' => '32000', - 'kern.ipc.shmmni' => '4096' - ); - $tunables = array(); - if (file_exists("/boot/loader.conf")) { - $lt = file_get_contents("/boot/loader.conf"); - $lt = explode("\n", $lt); - foreach ($lt as $num => $line) { - list($tunable, $val) = explode("=", $line, 2); - if (array_key_exists($tunable, $want_tunables) || empty($tunable)) - unset($lt[$num]); - } + $conf = "Server=$Server\n"; + $conf .= "ServerPort=$ServerPort\n"; + $conf .= "Hostname=$Hostname\n"; + $conf .= "PidFile=/var/run/zabbix/zabbix_proxy.pid\n"; + $conf .= "DBName=/var/db/zabbix/proxy.db\n"; + $conf .= "LogFile=/var/log/zabbix/zabbix_proxy.log\n"; + $conf .= "ConfigFrequency=$ConfigFrequency\n"; + $conf .= "FpingLocation=/usr/local/sbin/fping\n"; + /* there's currently no fping6 (IPv6) dependency in the package, but if there was, the binary would likely also be in /usr/local/sbin */ + $conf .= "Fping6Location=/usr/local/sbin/fping6\n"; + $conf .= "ProxyMode=$Mode\n"; + + file_put_contents("/usr/local/etc/zabbix/zabbix_proxy.conf", $conf); + + $want_sysctls = array( + 'kern.ipc.shmall' => '2097152', + 'kern.ipc.shmmax' => '2147483648', + 'kern.ipc.semmsl' => '250' + ); + $sysctls = array(); + if (file_exists("/etc/sysctl.conf")) { + $sc = file_get_contents("/etc/sysctl.conf"); + $sc = explode("\n", $sc); + foreach ($sc as $num => $line) { + list($sysctl, $val) = explode("=", $line, 2); + if (array_key_exists($sysctl, $want_sysctls) || empty($sysctl)) + unset($sc[$num]); } - foreach ($want_tunables as $wt => $wv) { - $lt[] = "{$wt}={$wv}"; + } + foreach ($want_sysctls as $ws => $wv) { + $sc[] = "{$ws}={$wv}"; + exec("/sbin/sysctl {$ws}={$wv}"); + } + file_put_contents("/etc/sysctl.conf", implode("\n", $sc) . "\n"); + + $want_tunables = array( + 'kern.ipc.semopm' => '100', + 'kern.ipc.semmni' => '128', + 'kern.ipc.semmns' => '32000', + 'kern.ipc.shmmni' => '4096' + ); + $tunables = array(); + if (file_exists("/boot/loader.conf")) { + $lt = file_get_contents("/boot/loader.conf"); + $lt = explode("\n", $lt); + foreach ($lt as $num => $line) { + list($tunable, $val) = explode("=", $line, 2); + if (array_key_exists($tunable, $want_tunables) || empty($tunable)) + unset($lt[$num]); } - file_put_contents("/boot/loader.conf", implode("\n", $lt) . "\n"); - chmod("/var/log/zabbix", 0755); - chmod("/var/run/zabbix", 0755); - conf_mount_ro(); + } + foreach ($want_tunables as $wt => $wv) { + $lt[] = "{$wt}={$wv}"; + } + file_put_contents("/boot/loader.conf", implode("\n", $lt) . "\n"); + chmod("/var/log/zabbix", 0755); + chmod("/var/run/zabbix", 0755); + conf_mount_ro(); - ]]> + ]]> </custom_php_resync_config_command> <custom_php_deinstall_command> - <![CDATA[ - exec("kill `cat /var/run/zabbix/zabbix_proxy.pid`"); + <![CDATA[ + exec("kill `cat /var/run/zabbix/zabbix_proxy.pid`"); - exec("/bin/rm /usr/local/etc/rc.d/zabbix_proxy.sh"); + exec("/bin/rm /usr/local/etc/rc.d/zabbix_proxy.sh"); - exec("/bin/rm -r /var/log/zabbix/"); - exec("/bin/rm -r /var/run/zabbix/"); - exec("/bin/rm -r /var/db/zabbix/"); + exec("/bin/rm -r /var/log/zabbix/"); + exec("/bin/rm -r /var/run/zabbix/"); + exec("/bin/rm -r /var/db/zabbix/"); ]]> </custom_php_deinstall_command> </packagegui>
\ No newline at end of file |