Blog
October 7, 2015 Marie H.

log_warning_msg not found on init script

log_warning_msg not found on init script

Photo by <a href="https://unsplash.com/@jakubzerdzicki?utm_source=cloudista&utm_medium=referral" target="_blank" rel="noopener">Jakub Żerdzicki</a> on <a href="https://unsplash.com/?utm_source=cloudista&utm_medium=referral" target="_blank" rel="noopener">Unsplash</a>

Setting up infrastructure monitoring is one beast; however when you have no logs and are forced into strace to debug configuration issues life is just no fun. I came across this issue recently when setting up host groups for Shinken monitoring in our infrastructure. I was hit with the following when running a configuration check:

[root@shinken hostgroups]# /etc/init.d/shinken check
Doing config check
/etc/init.d/shinken: line 525: log_warning_msg: command not found
/etc/init.d/shinken: line 526: log_failure_msg: command not found

As you can see that is pretty useless in helping determine what the problem is with the configuration especially after adding 30 new hosts and 3 different host groups. The problem was that the Red Hat 7 box running monitoring didn’t have the log_warning_msg and log_failure_msg functions provided in lsb. So to resolve this lets go ahead and install those functions:

[root@shinken ~]# yum -y install redhat-lsb redhat-lsb-core

Now when we run our configuration check, boom something to work with:

[root@shinken ~]# /etc/init.d/shinken check
Doing config check
full result is in /tmp/shinken_checkconfig_result          [WARNING]
ConfigCheck failed: Configuration is incorrect, sorry, I ba[FAILED]