首页
友情链接
统计分析
4K壁纸
搜索
1
#1031 – TABLE STORAGE ENGINE FOR ” DOESN’T HAVE THIS OPTION解决方法
1,033 阅读
2
让浏览器不显示 https 页面中 http 请求警报 http-equiv=”Content-Security-Policy” content=”upgrade-insecure-requests”
785 阅读
3
报错代码:ERROR 1227 (42000)-解决办法
592 阅读
4
微信个人商户号养号建议
500 阅读
5
解决移动端position:fixed随软键盘移动的问题
426 阅读
PHP
Mysql
乱七八糟
常用笔记
Linux
Reids
Search
标签搜索
php
千卡云支付
Linux
千卡云
千卡易支付
redis
Nginx
shell
Mysql
JS
支付宝
CentOS
Apache
支付
function
database
fastadmin
phpstorm
快捷键
微信支付
蓝科迪梦
累计撰写
59
篇文章
累计收到
1
条评论
首页
栏目
PHP
Mysql
乱七八糟
常用笔记
Linux
Reids
页面
友情链接
统计分析
4K壁纸
搜索到
1
篇与
的结果
2024-10-22
fas_openvpn进程守护
/var/www/html/目录下新建monitor.php,开启755权限 原来的守护脚本for循环里加一句:cd /var/www/html/;php monitor.php &>/dev/null monitor.php如下: <?php require('system.php'); $overtime = 10; $time = time(); $path_log = R.'/monitor.txt'; //log大于3MB则清空 if(filesize($path_log) > 1024*1024*3){ file_put_contents($path_log, ""); } if(strstr(end(file($path_log)), date('Y-m-d H:i:s')) != false){ exit('已经监控过啦'); } $files[0]["file"] = "openvpn_api/online_1194.txt"; $files[0]["telnet"] = "systemctl stop openvpn@server1194;systemctl start openvpn@server1194"; $files[1]["file"] = "openvpn_api/online_1195.txt"; $files[1]["telnet"] = "systemctl stop openvpn@server1195;systemctl start openvpn@server1195"; $files[2]["file"] = "openvpn_api/online_1196.txt"; $files[2]["telnet"] = "systemctl stop openvpn@server1196;systemctl start openvpn@server1196"; $files[3]["file"] = "openvpn_api/online_1197.txt"; $files[3]["telnet"] = "systemctl stop openvpn@server1197;systemctl start openvpn@server1197"; $files[4]["file"] = "openvpn_api/user-status-udp.txt"; $files[4]["telnet"] = "systemctl stop openvpn@server-udp;systemctl start openvpn@server-udp"; $msg = ''; foreach ($files as $k => $v){ $arr = [ 'file' => $v['file'], 'uptime' => date("Y-m-d H:i:s",filemtime($v['file'])), 'nowtime' => date("Y-m-d H:i:s",time()), ]; // var_export($arr); if((filemtime($v['file'])+$overtime) < $time){ $msg .= $v['file']; systemi("{$v['telnet']}"); file_put_contents($path_log,date('Y-m-d H:i:s').' 异常重启项:'.json_encode($arr)."\r\n",FILE_APPEND); } } if($msg == '') { echo "暂无异常"; file_put_contents($path_log,date('Y-m-d H:i:s').' 暂无异常。'."\r\n",FILE_APPEND); }else{ echo "异常项已重启:{$msg}"; }
2024年10月22日
24 阅读
0 评论
0 点赞