I was getting strange errors and it turns out, the status page was displaying garbage, the following line was doing it, for now I'm commenting it out.
But does someone knows what the problem is?
in nagios.module:242
if (!empty($value['text'])) {
$tmp_state .= '=' . $value['text'];
}
This was the content of $value:
Array ( [status] => NAGIOS_STATUS_ERROR [type] => state [text] => type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line., type: php %message in %file on line %line. )
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | nagios-Fix_nagios_check_watchdog-1897026-6.patch | 1.11 KB | ben coleman |
| #5 | 1897026-4-nagios-check-watchdog.patch | 5.45 KB | carsten müller |
| #3 | 1897026-3-nagios-check-watchdog.patch | 5.35 KB | carsten müller |
Comments
Comment #1
pjeutr commentedI' not sure when, but sometimes (when db connection is gone?) "%message in %file on line %line" gets in the watchdog table, this trips up code around nagios.module:511
Probably better to improve the untangle/unserialize code. But I did the following hack:
if ($nagios_severity < $min_severity){
replaced by
if ($nagios_severity < $min_severity || $row[type] == 'php'){
Comment #2
dgtlmoon commentedI've seen this issue in the wild also
Comment #3
carsten müller commentedHi,
here is a patch to fix this problem.
The problem is the watchdog check, the placeholders are not replaced by the values.
before
afterwards
Comment #4
carsten müller commentedsorry, this is a ptch for the Drupal 6 version of the module.
Comment #5
carsten müller commentedhere is a little bit improved version avoiding warnings if the variables are not set. Also D6 version patch.
Comment #6
ben coleman commentedThe patches in #3 and #5 both fail to apply against both 6.x-1.3 and 6.x-1.x. The patches include unrelated whitespace corrections, the removal of apparent debugging code that isn't in the original, and the primary code change hunk fails to apply because the surrounding code in the patch does not match what is in the original. The patches are also generated from the standpoint of the site as a whole, rather than just against the module (the patch is against sites/all/modules/contrib/nagios/nagios.module, instead of being against nagios.module).
Attached is a patch for the intended change that does apply against 6.x-1.3 and 6.x-1.x. This appears to work.
Comment #8
greg.harveyI reviewed this, looks fine, thanks for the code all. Committed to 6.x-1.x-dev.