]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fixed Bug#2018 - The threshold of cpu warning message should be increased
authorwadam <wadam@sangoma.com>
Thu, 1 Dec 2011 16:40:18 +0000 (11:40 -0500)
committerwadam <wadam@sangoma.com>
Thu, 1 Dec 2011 16:40:18 +0000 (11:40 -0500)
libs/freetdm/src/ftdm_io.c

index 0205ab36b1836bdcaea4db1fdd630a7f53f21da9..8ec6a3344fc38f08f9bd32b05026627b74e3a355 100644 (file)
@@ -5594,15 +5594,15 @@ static void *ftdm_cpu_monitor_run(ftdm_thread_t *me, void *obj)
 
                if (monitor->alarm) {
                        if ((int)time >= (100 - monitor->set_alarm_threshold)) {
-                               ftdm_log(FTDM_LOG_DEBUG, "CPU alarm OFF (idle:%d)\n", (int) time);
+                               ftdm_log(FTDM_LOG_DEBUG, "CPU alarm is OFF (cpu usage:%d)\n", (int) (100-time));
                                monitor->alarm = 0;
                        }
-                       if (monitor->alarm_action_flags & FTDM_CPU_ALARM_ACTION_WARN) {
+                       if (monitor->alarm && (monitor->alarm_action_flags & FTDM_CPU_ALARM_ACTION_WARN)) {
                        ftdm_log(FTDM_LOG_WARNING, "CPU alarm is ON (cpu usage:%d)\n", (int) (100-time));
                        }
                } else {
                        if ((int)time <= (100-monitor->reset_alarm_threshold)) {
-                               ftdm_log(FTDM_LOG_DEBUG, "CPU alarm ON (idle:%d)\n", (int) time);
+                               ftdm_log(FTDM_LOG_DEBUG, "CPU alarm is ON (cpu usage:%d)\n", (int) (100-time));
                                monitor->alarm = 1;
                        }
                }