Monitoring ideas, Architecture introduction
Requirements: Use the shell to customize a variety of personalized alarm tools, but the need for unified management, standardized management.
Idea: Specify a script package that contains the main program, subroutine, configuration file, mail engine, output log, and so on.
Main program: As a script entrance, is the lifeblood of the entire system.
Profile: is a control center used to switch individual subroutines, specifying each associated log file.
Subroutine: This is the real monitoring script, used to monitor each indicator. Definition can
Mail Engine: It is implemented by a PHP program, it can define the server that sends the mail, send the mail person and receive the mail person.
Output log: The entire monitoring system should have a log output.
Requirements: We have a variety of machines, but all the machines have to deploy the same monitoring system, that is, the role of the machine, no matter what role, the entire system framework is consistent, different places according to different customization of different configuration files.
Program Architecture:
Home Directory (Mon)
Next Level directory: Bin (main program Ah, main.sh) Conf (profile mon.conf) shares (various monitoring scripts load.sh 502.sh) mail (mail engine mail.php mail.sh) log (log Mon.log Err.log)
Create each directory according to the directory structure above
cd/usr/local/sbinmkdir moncd monmkdir bin conf shares mail log
Shell Programming Combat 1.1 Introduction to the framework of monitoring ideas