mirror of
https://gitlab.com/JKANetwork/CheckServer.git
synced 2026-02-23 05:23:50 +01:00
Fixing cronchk and adding JSON API check (WIP)
This commit is contained in:
@@ -74,7 +74,7 @@ function getSystemOpt($sysopt){
|
||||
return dbw_query_fetch_array(getconn(),"SELECT * FROM SYS WHERE option = '$sysopt'")['value'];
|
||||
}
|
||||
|
||||
/** Return HttpCode of page. Returns false if page is not found */
|
||||
/** Return HttpCode of page. Returns false if page is not found (Used in cron) */
|
||||
function httpCode($url, $wait = 5)
|
||||
{
|
||||
$ch = curl_init();
|
||||
@@ -127,7 +127,7 @@ function nameFromIDC($ID_C){
|
||||
}
|
||||
|
||||
function nameGroupFromIDG($ID_G){
|
||||
return dbw_query_fetch_array(getconn(),"SELECT * FROM GROUPS WHERE ID_G='$ID_G'")['name'];
|
||||
return dbw_query_fetch_array(getconn(),"SELECT ID_G,name FROM GROUPS WHERE ID_G='$ID_G'")['name'];
|
||||
}
|
||||
|
||||
function IDGFromIDC($ID_C){
|
||||
@@ -137,19 +137,22 @@ function IDGFromIDC($ID_C){
|
||||
/* This funtion returns the array with type of checks */
|
||||
function arrayTypeChk(){
|
||||
return array(
|
||||
'1' => 'PING_IP',
|
||||
'2' => 'HTTP_CODE',
|
||||
'3' => 'VISIT_COUNT',
|
||||
'4' => 'DATABASE');
|
||||
1 => 'PING_IP',
|
||||
2 => 'HTTP_CODE',
|
||||
3 => 'VISIT_COUNT',
|
||||
4 => 'DATABASE',
|
||||
5 => 'JSON_API');
|
||||
}
|
||||
/* This funtion returns the translated text of a type check */
|
||||
function textTypeChk($typeChk){
|
||||
$T_ = loadLang();
|
||||
$arr = array(
|
||||
'1' => $T_['PING_IP'],
|
||||
'2' => $T_['HTTP_CODE'],
|
||||
'3' => $T_['VISIT_COUNT'],
|
||||
'4' => $T_['DATABASE']);
|
||||
1 => $T_['PING_IP'],
|
||||
2 => $T_['HTTP_CODE'],
|
||||
3 => $T_['VISIT_COUNT'],
|
||||
4 => $T_['DATABASE'],
|
||||
5 => $T_['JSON_API']
|
||||
);
|
||||
return $arr[$typeChk];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user