本文整理汇总了PHP中usersMenus::EnableDNSMASQ方法的典型用法代码示例。如果您正苦于以下问题:PHP usersMenus::EnableDNSMASQ方法的具体用法?PHP usersMenus::EnableDNSMASQ怎么用?PHP usersMenus::EnableDNSMASQ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类usersMenus
的用法示例。
在下文中一共展示了usersMenus::EnableDNSMASQ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
//.........这里部分代码省略.........
$f[] = "\tif 5 restarts within 5 cycles then timeout";
$f[] = "";
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring NgINX...\n";
}
@file_put_contents("/etc/monit/conf.d/APP_NGINX.monitrc", @implode("\n", $f));
}
}
//********************************************************************************************************************
build_progress_restart("{reconfiguring}", 40);
$f = array();
if (is_file("/etc/init.d/sysklogd")) {
$f[] = "check process APP_SYSLOGD with pidfile /var/run/syslogd.pid";
$f[] = "\tstart program = \"/etc/init.d/sysklogd start --monit\"";
$f[] = "\tstop program = \"/etc/init.d/sysklogd stop --monit\"";
$f[] = "\tif 5 restarts within 5 cycles then timeout";
$f[] = "\tcheck file syslogd_file with path /var/log/syslog";
$f[] = "\tif timestamp > 10 minutes then restart";
$f[] = "";
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring sysklogd...\n";
}
@file_put_contents("/etc/monit/conf.d/APP_SYSKLOGD.monitrc", @implode("\n", $f));
}
//********************************************************************************************************************
build_progress_restart("{reconfiguring}", 41);
$binpath = $unix->DHCPD_BIN_PATH();
@unlink("/etc/monit/conf.d/APP_DHCPD.monitrc");
$f = array();
if (is_file($binpath)) {
$EnableDHCPServer = $sock->GET_INFO("EnableDHCPServer");
if (!is_numeric($EnableDHCPServer)) {
$EnableDHCPServer = 0;
}
if ($EnableDHCPServer == 1) {
$f[] = "check process APP_DHCP with pidfile /var/run/dhcpd.pid";
$f[] = "\tstart program = \"/etc/init.d/isc-dhcp-server start --monit\"";
$f[] = "\tstop program = \"/etc/init.d/isc-dhcp-server stop --monit\"";
$f[] = "\tif 5 restarts within 5 cycles then timeout";
$f[] = "";
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring DHCP Service...\n";
}
@file_put_contents("/etc/monit/conf.d/APP_DHCPD.monitrc", @implode("\n", $f));
}
}
//********************************************************************************************************************
$binpath = $unix->find_program("rdpproxy");
build_progress_restart("{reconfiguring}", 42);
@unlink("/etc/monit/conf.d/APP_RDPPROXY.monitrc");
$f = array();
if (is_file($binpath)) {
$EnableRDPProxy = $sock->GET_INFO("EnableRDPProxy");
if (!is_numeric($EnableRDPProxy)) {
$EnableRDPProxy = 0;
}
if ($EnableRDPProxy == 1) {
$f[] = "check process APP_RDPPROXY with pidfile /var/run/redemption/rdpproxy.pid";
$f[] = "\tstart program = \"/etc/init.d/rdpproxy start --monit\"";
$f[] = "\tstop program = \"/etc/init.d/rdpproxy stop --monit\"";
$f[] = "\tif 5 restarts within 5 cycles then timeout";
$f[] = "";
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring RDP Proxy...\n";
}
@file_put_contents("/etc/monit/conf.d/APP_RDPPROXY.monitrc", @implode("\n", $f));
}
}
//********************************************************************************************************************
build_progress_restart("{reconfiguring}", 43);
@unlink("/etc/monit/conf.d/APP_DNSMASQ.monitrc");
$f = array();
$binpath = $unix->find_program("dnsmasq");
if (is_file($binpath)) {
$EnableDNSMASQ = $users->EnableDNSMASQ();
if ($EnableDNSMASQ == 1) {
$f[] = "check process APP_DNSMASQ with pidfile /var/run/dnsmasq.pid";
$f[] = "\tstart program = \"/etc/init.d/dnsmasq start --monit\"";
$f[] = "\tstop program = \"/etc/init.d/dnsmasq stop --monit\"";
$f[] = "\tif 5 restarts within 5 cycles then timeout";
$f[] = "";
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring DNSMasq Service...\n";
}
@file_put_contents("/etc/monit/conf.d/APP_DNSMASQ.monitrc", @implode("\n", $f));
}
}
//********************************************************************************************************************
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} checking syslog\n";
}
if (is_file("/etc/init.d/syslog")) {
checkDebSyslog();
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} configuration done\n";
}
shell_exec($GLOBALS["MONIT_CLASS"]->monitor_all_cmdline . " 2>&1");
build_progress_restart("{reconfiguring}", 45);
}
示例2: build
//.........这里部分代码省略.........
if ($EnableNginx == 1) {
$f = array();
$f[] = "check process APP_NGINX with pidfile /var/run/nginx.pid";
$f[] = "\tstart program = \"/etc/init.d/nginx start --monit\"";
$f[] = "\tstop program = \"/etc/init.d/nginx stop --monit\"";
$f[] = "\tif 5 restarts within 5 cycles then timeout";
$f[] = "";
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring NgINX...\n";
}
@file_put_contents("/etc/monit/conf.d/APP_NGINX.monitrc", @implode("\n", $f));
}
}
//********************************************************************************************************************
$f = array();
if (is_file("/etc/init.d/sysklogd")) {
$f[] = "check process APP_SYSLOGD with pidfile /var/run/syslogd.pid";
$f[] = "\tstart program = \"/etc/init.d/sysklogd start --monit\"";
$f[] = "\tstop program = \"/etc/init.d/sysklogd stop --monit\"";
$f[] = "\tif 5 restarts within 5 cycles then timeout";
$f[] = "\tcheck file syslogd_file with path /var/log/syslog";
$f[] = "\tif timestamp > 10 minutes then restart";
$f[] = "";
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring sysklogd...\n";
}
@file_put_contents("/etc/monit/conf.d/APP_SYSKLOGD.monitrc", @implode("\n", $f));
}
//********************************************************************************************************************
$binpath = $unix->DHCPD_BIN_PATH();
@unlink("/etc/monit/conf.d/APP_DHCPD.monitrc");
$f = array();
if (is_file($binpath)) {
$EnableDHCPServer = $sock->GET_INFO("EnableDHCPServer");
if (!is_numeric($EnableDHCPServer)) {
$EnableDHCPServer = 0;
}
if ($EnableDHCPServer == 1) {
$f[] = "check process APP_DHCP with pidfile /var/run/dhcpd.pid";
$f[] = "\tstart program = \"/etc/init.d/isc-dhcp-server start --monit\"";
$f[] = "\tstop program = \"/etc/init.d/isc-dhcp-server stop --monit\"";
$f[] = "\tif 5 restarts within 5 cycles then timeout";
$f[] = "";
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring DHCP Service...\n";
}
@file_put_contents("/etc/monit/conf.d/APP_DHCPD.monitrc", @implode("\n", $f));
}
}
//********************************************************************************************************************
$binpath = $unix->find_program("rdpproxy");
@unlink("/etc/monit/conf.d/APP_RDPPROXY.monitrc");
$f = array();
if (is_file($binpath)) {
$EnableRDPProxy = $sock->GET_INFO("EnableRDPProxy");
if (!is_numeric($EnableRDPProxy)) {
$EnableRDPProxy = 0;
}
if ($EnableRDPProxy == 1) {
$f[] = "check process APP_RDPPROXY with pidfile /var/run/redemption/rdpproxy.pid";
$f[] = "\tstart program = \"/etc/init.d/rdpproxy start --monit\"";
$f[] = "\tstop program = \"/etc/init.d/rdpproxy stop --monit\"";
$f[] = "\tif 5 restarts within 5 cycles then timeout";
$f[] = "";
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring RDP Proxy...\n";
}
@file_put_contents("/etc/monit/conf.d/APP_RDPPROXY.monitrc", @implode("\n", $f));
}
}
//********************************************************************************************************************
@unlink("/etc/monit/conf.d/APP_DNSMASQ.monitrc");
$f = array();
$binpath = $unix->find_program("dnsmasq");
if (is_file($binpath)) {
$EnableDNSMASQ = $users->EnableDNSMASQ();
if ($EnableDNSMASQ == 1) {
$f[] = "check process APP_DNSMASQ with pidfile /var/run/dnsmasq.pid";
$f[] = "\tstart program = \"/etc/init.d/dnsmasq start --monit\"";
$f[] = "\tstop program = \"/etc/init.d/dnsmasq stop --monit\"";
$f[] = "\tif 5 restarts within 5 cycles then timeout";
$f[] = "";
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring DNSMasq Service...\n";
}
@file_put_contents("/etc/monit/conf.d/APP_DNSMASQ.monitrc", @implode("\n", $f));
}
}
//********************************************************************************************************************
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} checking syslog\n";
}
if (is_file("/etc/init.d/syslog")) {
checkDebSyslog();
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} configuration done\n";
}
shell_exec($GLOBALS["MONIT_CLASS"]->monitor_all_cmdline . " 2>&1");
}