Nagios secondary development: "Drawing service diagrams by group"
Background:
Nagios3.2.0 has integrated nagios, saltstack, and Thinkphp. Based on integration, secondary development is carried out to add functions such as grouping and plotting, asset management, and server batch management. The Thinkphp framework is used for asset addition, deletion, modification, and query. The grouping plot is used to write the grouping page separately and call the pnp interface. The server Batch Management relies on the powerful APIs of saltstack, such:
Figure 1 plot by Business Group
Figure 2 Asset Management and server Batch Management
The above system has been applied to the online environment. Next we will describe "Draw service diagrams by group" as a secondary development based on nagios 4.1.1.
I. Requirements
Draw a service diagram by group
II,
Figure 3 grouping check box
Figure 4 plotting by Business Group
Iii. Implementation Process
1) modify the original nagios status. cgi file and add the check box and the js Code that is fully selected.
2) switch to the pnp4nagios installation directory, add the graphview. php file, and append the php code for grouping and plotting.
Iv. Summary
1) Compared with the secondary development of nagios3.2.0, the implementation of the grouping and plotting function only depends on nagios + pnp4nagios and does not use thinkphp for grouping.
2) with the development of nagios3.2.0, you can directly modify the source code when modifying nagios4.1.1 again, reducing the complexity and accelerating the project progress.
4) no matter which kind of open-source software, as long as you carefully study your business needs, there will always be a bright spot!