-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix poller_servcheck.php does not run any test when it runs automatically from cacti poller (Issue #31) #32
base: main
Are you sure you want to change the base?
Conversation
order by the statistics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly review the fixes and authorize (if possible)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like maybe an error in the display text array.
Hey @TheWitness Can you advise which file you suspect to have an error in the display text array? what is the array name? |
$sql_condition = ' '; | ||
} else { | ||
$sql_condition = ' AND id = ' . $test_id; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ups, good catch @MSS970
Hi @TheWitness , Do you see any issue with pull request, or it is good to go. Regards, |
@MSS970 , I should be able to look at it tomorrow. Busy tonight. |
poller_servcheck.php does not run any test when it runs automatically from cacti poller
The issue is related to the logic at line 117 to 121:
$tests = db_fetch_assoc_prepared('SELECT *
FROM plugin_servcheck_test
WHERE enabled = "on"
AND poller_id = ? AND id = ?',
array($poller_id, $test_id));
The code could be enhanced as follows:
if ($test_id == 0) {
$sql_condition = ' ';
} else {
$sql_condition = ' AND id = ' . $test_id;
}
$tests = db_fetch_assoc_prepared('SELECT *
FROM plugin_servcheck_test
WHERE enabled = "on"
AND poller_id = ? ' .
$sql_condition,
array($poller_id));
furthermore, typo in arrays.php line 326 "disabled" should be "disable"
in servecheck_test.php, add the following after line 1019 ($sql_order = get_order_string();):