- edited description
Strange output in mmonit, parsing non-standard characters
How to reproduce: Try create file with special characters. For example:
cat >> /root/testfile
Put some text, and press CTRL + H or CTRL + J, etc...
Press ENTER and after that CTRL + D
Add new program check Example:
check program test-alert with path "/root/test-alert.sh"
if status > 0 then alert
Now print file and redirect output too error stream inside script used by monit. Example:
#!/bin/bash
cat /root/testfile 2>&1
exit 1
Now look at dashboard: Example:
I guess special characters should be removed before Monit send it to M/Monit. Or before M/Monit serve it in REST API.
Quick fix inside script:
cat /root/testfile | tr -cd '\11\12\15\40-\176' 2>&1
Fix from: http://alvinalexander.com/blog/post/linux-unix/how-remove-non-printable-ascii-characters-file-unix
Confirmet in M/Monit 3.4, Monit 5.11 (test environment) and M/Monit 3.3, Monit 5.10 (production environment).
Comments (5)
-
reporter -
repo owner Hello,
please can you attached the /root/testfile with characters which trigger the issue? We tried to reproduce the problem using the given steps, but are unable to reproduce it (with M/Monit 3.5.1).
Best regards, M/Monit team
-
repo owner Hello, we have reproduced the problem inhouse, working on fix.
-
repo owner - changed status to resolved
fixed in the next M/Monit release (3.5.2)
-
repo owner - removed version
Removing version: 5.11 (automated comment)
- Log in to comment