Background:
In the nagios3.2.0 version, Nagios, Saltstack, and thinkphp were integrated. On the basis of integration, we have developed two times, added the functions of group plot, asset Management and server batch management. Asset additions and deletions are based on the thinkphp framework; Group plot separate write group page, call PnP interface; Server bulk management relies on Saltstack's powerful API, such as:
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/8C/23/wKioL1hjd9iRkXYWAAFLxpJMRtA320.png-wh_500x0-wm_3 -wmp_4-s_959351166.png "title=" Nagios two-time development "based on group drawing service Map" "alt=" Wkiol1hjd9irkxywaaflxpjmrta320.png-wh_50 "/>
Figure 1 Plot by business group
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/8C/23/wKioL1hjeBChFRfaAABWfiF9UT0884.png-wh_500x0-wm_3 -wmp_4-s_4174133898.png "title=" Nagios two-time development "based on group drawing service Map" "alt=" Wkiol1hjebchfrfaaabwfif9ut0884.png-wh_50 "/>
Figure 2 Asset Management and server batch management
The above system has been applied to the online environment. The next step we'll talk about is the "map by group Mapping", which is a two-time development on the basis of Nagios 4.1.1.
First, the demand
Drawing Service Map by grouping
Two
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8C/27/wKiom1hjeHHx0SonAAE2qoR6KPM172.png-wh_500x0-wm_3 -wmp_4-s_4012524468.png "title=" Nagios two-time development "based on group drawing service Map" "alt=" Wkiom1hjehhx0sonaae2qor6kpm172.png-wh_50 "/>
Figure Three grouping check box
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8C/23/wKioL1hjeKKjT2y7AABs8J-vYNM237.png-wh_500x0-wm_3 -wmp_4-s_2606604868.png "title=" Nagios two-time development "based on group drawing service Map" "alt=" Wkiol1hjekkjt2y7aabs8j-vynm237.png-wh_50 "/>
Figure IV Plot by business group
Third, the realization process
1) Modify the status.cgi original file of Nagios, add check box and corresponding JS code to implement the full selection.
2) switch to the Pnp4nagios installation directory, add the graphview.php file, and append the PHP code that handles the group plot.
Iv. Summary
1) compared to the nagios3.2.0 version of the two development, the implementation of this sub-plot function is only dependent on Nagios+pnp4nagios, not with the help of thinkphp group
2) The development of nagios3.2.0, once again modified nagios4.1.1, can directly modify the source code, reduce the complexity, while speeding up the project progress
4) No matter what kind of open source software, as long as the combination of their business needs to study hard, there will always be a shining spot!
This article is from the "Beijing Open source people Linux operation and Maintenance" blog, please be sure to keep this source http://bdkyr.blog.51cto.com/7961566/1886959
Nagios Two-time development "based on Group mapping service Map"