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 the entire script portal, is the lifeblood of the entire system.
configuration file: is a control center that uses it to switch individual subroutines, specifying each associated log file.
subroutine: This is the real monitoring script, used to monitor each indicator.
Mail Engine: It is implemented by a PHP program, it can define the server to send the mail, the sender and the mail recipient.
output log: The entire monitoring system should have a log output.
Requirements: Our machine roles are varied, but the same monitoring system is deployed on all machines, and the entire program framework is consistent, regardless of the role of all machines, depending on the role of the different configuration files.
Program Architecture:
(main directory Mon)
____________________|_______________________________
| | | | |
bin conf shares mail log
| | | | |
[ main.sh] [mon.conf] [load.sh 502.sh] [mail.php mail.sh] [mon.log Err.log]
under Bin is the main program
conf is the configuration file
shares is the various monitoring scripts
Mail engine under Mail
log is the journal.
Monitoring System Main Script explanation
This article is from the "small white Growth" blog, please be sure to keep this source http://guxing.blog.51cto.com/3685384/1767941
Hell Programming-shell Programming Combat