...
|
...
|
@@ -41,7 +41,7 @@ import java.util.concurrent.ThreadFactory; |
|
|
@EnableScheduling
|
|
|
public class ZabbixAlarm {
|
|
|
|
|
|
private static String ALARMTEMPLATE = "时间:%s,ip:%s,CPU使用率:%s,可用内存/总内存(MB):%s,输入带宽:%.2fMbps,输出带宽:%.2fMbps";
|
|
|
private static String ALARMTEMPLATE = "时间:%s,ip:%s,CPU使用率:%.2f\'%\',可用内存/总内存(MB):%s,输入带宽:%.2fMbps,输出带宽:%.2fMbps";
|
|
|
|
|
|
public static final Logger DEBUG = LoggerFactory.getLogger(ZabbixAlarm.class);
|
|
|
|
...
|
...
|
@@ -254,7 +254,7 @@ public class ZabbixAlarm { |
|
|
|
|
|
String nowString = DateTime.now().toString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
String alarmInfo = String.format(ALARMTEMPLATE, nowString, ip, String.valueOf(100 - idleCpu), String.valueOf(avMem) + " / " + String.valueOf(toMem), inNet, outNet);
|
|
|
String alarmInfo = String.format(ALARMTEMPLATE, nowString, ip, 100 - idleCpu, String.valueOf(avMem) + " / " + String.valueOf(toMem), inNet, outNet);
|
|
|
|
|
|
DEBUG.info("Alarm vm info {}", alarmInfo);
|
|
|
|
...
|
...
|
|