노드 시스템 상태 로그 확인 사용자 지정
패브릭 노드에 대한 시스템 상태 검사를 사용자 정의하여 필요한 모든 정보가 /var/log/SystemStatusLog 로그 파일에 기록되도록 합니다. 시스템 상태 확인을 사용자 정의하려면 시스템 관리자 권한이 있어야 합니다. /usr/nma/bin/writeLogCronJob에서 패브릭 노드 Perl 스크립트를 수정하여 시스템 상태 검사를 사용자 정의합니다.
패브릭 노드에 대한 시스템 상태 검사를 사용자 정의하려면 다음과 같이 writeLogCronJob에서 writeSystemStatusLogFile 하위 함수를 수정합니다.
sub writeSystemStatusLogFile{
my $err = 0;
my $logfile = $_[0];
$err = system("date >> $logfile");
$err = system("df /var >> $logfile");
$err = system("top -n 1 -b | grep Cpu >> $logfile");
$err = system("top -n 1 -b | grep Mem: >> $logfile");
$err = system("top -n 1 -b | grep Swap: >> $logfile");
***<Add additional system command here that you want to print out in the SystemStatusLog file>***
if ($err == 0 ) { print "write log to $logfile successfully\n";
} else { print "cannot write log to $logfile\n";
}
return $err;
}