Home > OS >  There is a great god will do the Linux script way realize monitoring error log file?
There is a great god will do the Linux script way realize monitoring error log file?

Time:01-06

1, the script the three major functions:
To monitor a specified file: file size and the ERROR information;
Set file is greater than a certain threshold, then move the file to a specified directory;
When containing mounting ERROR information, an alarm message to a specific email;
2, the requirements are as follows:
1) monitored file name and path can be set;
2) file size alarm threshold can be set up;
3) file moving target directory can be set up;
4) alarm email address can be set;
5) mobile file name after the name of the file and take minutes when (date) (month) (year);
6) monitor need to write the log: record the size of the monitor file, mobile information, send alarm messages;
7) artificial growth simulation file, until you reach mobile threshold;
8) for analog input ERROR information content, triggering the alarm mail;
9) monitoring cycle for 1 minute;
3, submit a script and run the screenshots:
1) the whole amount script: monitoring scripts, the clock script, email script;
2) run screenshot: mobile source directory and display file backup directory;
According to logging;
  • Related