mirror of
https://gitlab.com/JKANetwork/CheckServer.git
synced 2026-02-16 18:21:35 +01:00
Don't throw too much errors if not root ping
This commit is contained in:
15
README.md
15
README.md
@@ -1,8 +1,8 @@
|
|||||||
## For < 1.0 version (Legacy sqlite3 and simpler version), go here: https://gitlab.com/JKANetwork/CheckServer/tree/v0.9.4
|
## For < 1.0 version (Legacy sqlite3 and simpler version), go here: https://gitlab.com/JKANetwork/CheckServer/tree/v0.9.4
|
||||||
|
|
||||||
# CheckServer (New)
|
# CheckServer
|
||||||
|
|
||||||
CheckServer is a PHP app that monitor (using crons) some parameters in servers, ping to it, services, and views simple stadistics.
|
CheckServer is a PHP app that monitor (using cron) some parameters in servers, ping to it, services, and views simple stadistics.
|
||||||
It only needs PHP, MySQL, and for talking with Windows machines, Linux wmi-client package (I'm open to change with a PHP library that works)
|
It only needs PHP, MySQL, and for talking with Windows machines, Linux wmi-client package (I'm open to change with a PHP library that works)
|
||||||
|
|
||||||
Also has a index stadistics page for guests (Not logued)
|
Also has a index stadistics page for guests (Not logued)
|
||||||
@@ -16,11 +16,10 @@ Also has a index stadistics page for guests (Not logued)
|
|||||||
- Cron
|
- Cron
|
||||||
|
|
||||||
# Bugs
|
# Bugs
|
||||||
- Ping needs root because socket use in some distros, can be used in cron
|
- Ping needs root because socket use in some distros, only will refresh in cron (Run php as root in cron).
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
Download last version from https://gitlab.com/JKANetwork/CheckServer/tags (not git master, reason
|
Download last version from https://gitlab.com/JKANetwork/CheckServer/tags (Tags=Releases, master is not released quality code), unzip it and copy all to the folder in your hosting.
|
||||||
below. Think of tags as releases), unzip it and copy all to the folder in your hosting.
|
|
||||||
|
|
||||||
Go to browser, /install.php and follow the installer
|
Go to browser, /install.php and follow the installer
|
||||||
|
|
||||||
@@ -32,9 +31,11 @@ For finishing it, you have to add a cron in your system for running checks. The
|
|||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
Allow http response views
|
- Allow http response views
|
||||||
|
|
||||||
At future, read sensors in routers/switchs/SNMP
|
- WMI support for Windows servers
|
||||||
|
|
||||||
|
- At future, read sensors in routers/switchs/SNMP
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,10 @@ function ping($ip, $timeout = 2,$rTimes = 2) {
|
|||||||
while ($retry < $rTimes){ //Retry rTimes times if fail
|
while ($retry < $rTimes){ //Retry rTimes times if fail
|
||||||
//Create ICMP socket and see if works
|
//Create ICMP socket and see if works
|
||||||
$package = "\x08\x00\x7d\x4b\x00\x00\x00\x00PingHost";
|
$package = "\x08\x00\x7d\x4b\x00\x00\x00\x00PingHost";
|
||||||
$socket = socket_create(AF_INET, SOCK_RAW, 1);
|
$socket = socket_create(AF_INET, SOCK_RAW, 1);
|
||||||
|
if ($socket == FALSE){ //If not works, please don't continue.
|
||||||
|
break;
|
||||||
|
}
|
||||||
socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => $timeout, 'usec' => 0));
|
socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => $timeout, 'usec' => 0));
|
||||||
socket_connect($socket, $ip, null);
|
socket_connect($socket, $ip, null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user