This article mainly elaborates the realization plan
Key words: Open-falcon, Javaxmail, apache-james to achieve complete alarm function, we need 5 steps:
1. Create Rule
2. Data collection
3. Compare rule data with collected data
4. Generate Alarm Data
5. Push Alarm Data
And in the pipeline platform, we have integrated small Michae source monitoring system Open-falcon, corresponding to the above analysis of the steps, we give the program is:
1. The k8s Cloud tube platform provides the alarm management module, may manage the alarm rule
2. The Open-falcon Agent module was developed two times, and the cadvisor was integrated to obtain not only the host data but also the container data
3. Use the Open-falcon Judge module to judge the alarm event
4. The alarm module of the Open-falcon was developed two times to read the rules-related data in the K8s Cloud control platform database, combined with the data produced by judge, Production of the full alarm data required
5. The sender module of Open-falcon has been developed two times, calling the cloud-tube platform to send the alarm interface (currently only do the mail alarm), realize the function of sending mail
A simple drawing of the process diagram is as follows:
From the point of view of data flow, we can see:
1. Rule data is the responsibility of the platform, mainly stored in MySQL
2. Alarm data is responsible by Open-falcon, mainly stored in Redis (RRD disk file persisted)
3. Finally, the complete alarm data in the Redis as parameters to the alarm mail send interface, complete the process
Next, I will specifically write down Open-falcon two development implementation details, Java Send mail key code implementation, and finally how to deploy a mailbox server (Apache-james) to achieve the delivery of mail