...
The problem is that the output must be written to a file. Sending it to the CMK Server would lead to a CRIT "Check_MK" service.
Enabling the Debug Mode
To write the debug output to a file on one monitored host, you have to do the following:
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
############################################# # Permamently enable debug mode # log rotation logfile=/var/log/agent.out max_logs=10 # Adjust the maximum number of stored log files to your needs. i=$max_logs while [ $i -gt 1 ]; do ((j=i-1)) if [ -f $logfile.$j ]; then mv $logfile.$j $logfile.$i fi i=$j done if [ -f $logfile ]; then mv $logfile $logfile.1 fi # write stderr to log set -xv exec 2>$logfile # Enabling debug END ############################################# |
Disabling the Debug Mode
To disable the debug mode, copy your original script:
Code Block | ||||
---|---|---|---|---|
| ||||
root@mylinuxhost:~# cp /usr/bin/check_mk_agent.bak /usr/bin/check_mk_agent |
Limitations
When you're using the Automatic Agent Updater, it might happen that your modified script will be overwritten.
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...