소스 검색

Added per cpu load average message

Added conditions with -r option in message with "load average per CPU"
chintan 10 년 전
부모
커밋
1e8db3deaa
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      plugins/check_load.c

+ 5 - 0
plugins/check_load.c

@@ -194,7 +194,12 @@ main (int argc, char **argv)
 
 
 	/* we got this far, so assume OK until we've measured */
 	/* we got this far, so assume OK until we've measured */
 	result = STATE_OK;
 	result = STATE_OK;
+	
+	if (take_into_account_cpus == 1 && (numcpus = GET_NUMBER_OF_CPUS()) > 1){
 
 
+	xasprintf(&status_line, _("load average per CPU: %.2f, %.2f, %.2f"), la1, la5, la15);
+	}
+	else
 	xasprintf(&status_line, _("load average: %.2f, %.2f, %.2f"), la1, la5, la15);
 	xasprintf(&status_line, _("load average: %.2f, %.2f, %.2f"), la1, la5, la15);
 
 
 	for(i = 0; i < 3; i++) {
 	for(i = 0; i < 3; i++) {