Nagios is a relatively common open-source monitoring software, Nagios flexible and lightweight so that in use can be used flexibly according to their actual situation, but Nagios has a drawback is not perfect for the drawing, so in the monitoring data used for analysis Nagios has a short board. But because Nagios is flexible so nagios can use other ways to achieve the display of graphical reports, here is a brief talk about the official Nagiosgraph plug-ins, nagiosgraph plug-ins have been used Perl to achieve, So in the use of Nagiosgraph plug-in to ensure that the system installed Perl and the corresponding CPAN source, so as to install, as for the CPAN source configuration has mentioned before, here do not explain, need to see:/http jim123.blog.51cto.com/4763600/1895093. Nagiosgraph plug-in official: https://sourceforge.net/projects/nagiosgraph/files/, it is recommended to download the latest stable version, before installing the deployment needs to check the system to install the plug-in required for the dependency package:
[[email protected] nagiosgraph-1.5.2]# perl install.pl --check-prereq# like this is all plug-ins have installed Checking required perl modules carp ... 1.11 cgi ... 3.51 data::D umper ... 2.124 digest::md5 ... 2.39 file::basename ... 2.77 file::find ... 1.14 mime::base64 ... 3.08 posix ... 1.17 rrds ... 1.3008 time::hires ... 1.9721checking optional perl modules gd ... 2.44 nagios::config ... 36checking nagios installation found nagios exectuable at /usr/local/ Nagios/bin/nagios found nagios init script at /etc/init.d/nagioschecking web server installation found apache executable at /usr/sbin/ HTTPD  FOUND APACHE INIT SCRIPT AT /ETC/INIT.D/HTTPD
If you find the installation is not installed, it is recommended to install a Yum source or apt source after installation such as GD drawing installation:
[Email protected] nagiosgraph-1.5.2]# yum-y install PERL-GD
There is generally a shortage of nagios::config modules installed under Perl, which are installed using CPAN after configuring the CPAN source
[[email protected] nagiosgraph-1.5.2]# CPAN nagios::config# Note that sometimes there will be a lack of digest::md5 modules, such as the same sequence installation can be
After you have resolved all dependencies, you can start the installation configuration and you will be prompted with the default options when you install the next step by pressing ENTER directly
[Email protected] nagiosgraph-1.5.2]# Perl install.pl
After installation, you should be aware that there are some configuration change configurations and how to do this in Nagios, such as:
# process nagios performance data using nagiosgraphprocess_performance_data= 1service_perfdata_file=/tmp/perfdata.logservice_perfdata_file_template= $LASTSERVICECHECK $| | $HOSTNAME $| | $SERVICEDESC $| | $SERVICEOUTPUT $| | $SERVICEPERFDATA $service_perfdata_file_mode=aservice_perfdata_file_processing_interval=30service_perfdata_file _processing_command=process-service-perfdata-for-nagiosgraph# Modify the Nagios configuration file and add/bin/systemctl in Nagios.cfg restart httpd.service * in the nagios commands file ( COMMAND.CFG), add these lines:# command to process nagios performance data for nagiosgraphdefine command { command_name process-service-perfdata-for-nagiosgraph command_line /usr/local/nagiosgraph/bin/insert.pl}# Add Modify command.cfg Config file * In the apache configuration file (httpd.conf), add this line:include /usr/local/nagiosgraph/etc/ nagiosgraph-apache.conf# add nagiosgraph containing * check the nagios in Nagios's httpd configuration file configuration:/usr/local/nagios/bin/nagios -v /path/to/nagios.cfg * restart nagios to start data collection:/etc/init.d/nagios restart * restart apache to enable display of graphs:/etc/init.d/httpd restart# Finally complete configuration after multiple check restarts * To enable graph links and mouseovers, see readme sections: displaying per-service and per-host graph icons and links displaying Graphs in nagios mouseovers
Same as Nagios open page Configuration Check page: http://IP/nagiosgraph/cgi-bin/showconfig.cgi650) this.width=650; "Src=" https://s4.51cto.com/ Wyfs02/m01/9e/80/wkiom1mrvmwxyuthaabz5h2rj4g901.png-wh_500x0-wm_3-wmp_4-s_4178348816.png "Title=" Nagiosgraph Configuration Check page "alt=" Wkiom1mrvmwxyuthaabz5h2rj4g901.png-wh_50 "/>
Verify that there are no problems before you change the Nagios php page file to the Nagios share folder side.php add Nagiosgraph to the link-making pseudo-static page:
<?php $nagiosgraph _path = '/nagiosgraph/cgi-bin ';? ><li><a >nagios Chart </a></li><ul><li><a href= "<?php echo $nagiosgraph _path;? >/show.cgi " target=" <?php echo $link _target;? > "> Chart </a></li><li><a href=" <?php echo $nagiosgraph _path;? >/showhost.cgi " target=" <?php echo $link _target;? > "> Host Chart </a></li><li><a href=" <?php echo $nagiosgraph _path;? >/showservice.cgi " target=" <?php echo $link _target;? > "> Services Chart </a></li><li><a href=" <?php echo $nagiosgraph _path;? >/showgroup.cgi " target=" <?php echo $link _target;? > "> Host Group chart </a></li></ul></li>
Finally, on the Nagios page there is a nagiosgraph chart link 650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/9E/81/ Wkiom1mrvtudo8ztaaoki0wprh8171.png-wh_500x0-wm_3-wmp_4-s_4248651793.png "title=" nagiosgraph chart link "alt=" Wkiom1mrvtudo8ztaaoki0wprh8171.png-wh_50 "/>
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/9E/6F/wKioL1mRv3bioD3QAABG8rI7VSo809.png-wh_500x0-wm_ 3-wmp_4-s_286579915.png "title=" nagiosgraph use "alt=" Wkiol1mrv3biod3qaabg8ri7vso809.png-wh_50 "/>"
Depending on the host and service you want to select, the Nagiosgraph configuration depends on Perl configuration or is relatively simple, but the resulting chart is not very perfect, but it can also meet some simple daily analysis, but if the need for better can be used for his software or plug-in implementation, Nagios's chart display.
This article from "Technical essay" blog, declined reprint!
Nagios plug-in Nagiosgraph installation deployment