Open source Monitoring solution Nagios+cacti+pnp4nagios+nconf+ndoutils+nagvis (eight) nconf Installation

Source: Internet
Author: User
<span id="Label3"></p><p><p><span style="color:rgb(255,0,0);"><strong><span style="font-family:‘黑体‘, SimHei;font-size:14px;">NCONF provides a web interface to manage the Nagios configuration, which puts the Nagios configuration file into the database, the user makes the appropriate modifications and clicks on the build profile, and Nconf writes the configuration to the configuration file from the Database. So the final Nagios configuration is still in the form of files, which is relative to nagiosql himself compared to the reasons for nconf, followed by nconf also provides a static file modification Page.</span></strong></span><br></p></p><p><p><br></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">first, Initialize the database<br>Mysql> CREATE DATABASE nconf default Character set utf8;<br>Mysql> Grant all privileges the nconf.* to ' nconf ' @ ' localhost ' identified by ' XXXX ' with Grant option;<br>Mysql> Grant all privileges the nconf.* to ' nconf ' @ '% ' identified by ' XXXX ' with Grant option;<br>Mysql> Flush privileges;<br><br>second, installation nconf<br>#tar-zxvf nconf-1.3.0-0.tgz-c/var/www/html/<br>#chown-r apache:apache/var/www/html/nconf<br><br>third, Initialize the nconf</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;"></span></p></p><p><p>650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/7C/7A/wKioL1bRU9DSDtD8AABrSxn3YWs007.png "style=" float: none; "title=" 111.png "alt=" wkiol1bru9dsdtd8aabrsxn3yws007.png "/></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">The second step needs to establish a soft connection, and note that the permissions of the original file should be modified to 777<br>#chmod 777/usr/local/nagios/bin/nagios<br>#ln-s/usr/local/nagios/bin/nagios/var/www/html/nconf/bin/</span><br></p></p><p><p>650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/7C/7C/wKiom1bRU17To9rSAACVwQ9IU0w391.png "style=" float: none; "title=" 222.png "alt=" wkiom1bru17to9rsaacvwq9iu0w391.png "/></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">#第四步结束后删除临时文件<br>#rm-rf/var/www/html/nconf/{install,install.php,update,update.php}</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;"><br></span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">third, Configure nconf sudo permissions and auto-generate configuration file</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">#visudo</span></p></p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;"><span style="font-family:‘黑体‘, SimHei;font-size:14px;color:rgb(255,0,0);"><span style="font-family:‘黑体‘, SimHei;font-size:14px;color:rgb(255,0,0);">Apache all= (all) Nopasswd:/etc/init.d/nagios<br></span></span><br><span style="font-family:‘黑体‘, SimHei;font-size:14px;color:rgb(255,0,0);"><span style="font-family:‘黑体‘, SimHei;font-size:14px;color:rgb(255,0,0);">//modify nconf configuration file<br></span></span>#cat/var/www/html/nconf/config/deployment.ini<br>[extract config]<br>Type = Local<br>Source_file = "/var/www/html/nconf/output/nagiosconfig.tgz"<br>Target_file = "/var/www/html/nconf/temp/"<br>Action = Extract<br><br>[copy collector config]<br>Type = Local<br>Source_file = "/var/www/html/nconf/temp/default_collector/"<br>Target_file = "/usr/local/nagios/etc/default_collector/"<br>Action = Copy<br><br>[copy Global config]<br>Type = Local<br>Source_file = "/var/www/html/nconf/temp/global/"<br>Target_file = "/usr/local/nagios/etc/global/"<br>Action = Copy<br>Reload_command = "sudo/etc/rc.d/init.d/nagios reload"</span></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;"><br></span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">Iv. nconf process for generating configuration files</span></p></p><p><p>650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/7C/7C/wKiom1bRU17T03MDAABLHIvDw1M686.png "style=" float: none; "title=" 333.png "alt=" wkiom1bru17t03mdaablhivdw1m686.png "/></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">Click <strong>Generate nagios config</strong> to detect if there is a problem with the Nagios configuration file</span></p></p><p><p><br></p></p><p><p>650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/7C/7C/wKiom1bRU1-T0Bo4AABLb_mSLk8003.png "style=" float: none; "title=" 444.png "alt=" wkiom1bru1-t0bo4aablb_mslk8003.png "/></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">When you click <strong>Deploy</strong> without a problem, the following process is installed and the path configured in the configuration file above is mounted to perform the relevant Operation.</span><br></p></p><p><p>650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7C/7C/wKiom1bRU1-TcrS3AAEabPKE0sE614.png "style=" float: none; "title=" 555.png "alt=" wkiom1bru1-tcrs3aaeabpke0se614.png "/></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">(1) in the <strong><span style="font-family:‘黑体‘, SimHei;color:rgb(255,0,0);">[extract config]</span></strong> configuration of the <strong><span style="font-family:‘黑体‘, SimHei;color:rgb(255,0,0);">source_file</span></strong> generated compressed files at the same time to back up the compressed files, and then extracted to <strong><span style="font-family:‘黑体‘, SimHei;color:rgb(255,0,0);">target_file</span></strong> below</span></p></p><p><p>650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/7C/7A/wKioL1bRU9KBL7URAAAh2AorszE958.png "style=" float: none; "title=" 666.png "alt=" wkiol1bru9kbl7uraaah2aorsze958.png "/></p></p><p><p><br></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">(2) copy <strong><span style="font-family:‘黑体‘, SimHei;color:rgb(255,0,0);">source_file</span></strong> files to target_file< according to the configuration of <strong><span style="font-family:‘黑体‘, SimHei;color:rgb(255,0,0);">[copy collector config]</span></strong> and <strong><span style="font-family:‘黑体‘, SimHei;color:rgb(255,0,0);">[copy global config]</span></strong> <strong><span style="font-family:‘黑体‘, SimHei;color:rgb(255,0,0);"> Under The/c7>.</span></strong><br><br>(3) performing Sudo/etc/init.d/nagios Reload</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;"><br></span><span style="font-family:‘黑体‘, SimHei;font-size:14px;">V. Import the existing configuration into the nconf</span><br></p></p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">(1) precautions<br>Importing avoids conflicts between configuration files as Follows:<br>1. timeperiods<br>2. Misccommands & Check_commands<br>3. Contacts<br>4. Contactgroups (considering that some contactgroups might being linked to Others)<br>5. Host-templates<br>6. parent-hosts, then remaining hosts<br>7. Hostgroups (considering that some hostgroups might being linked to Others)<br>8. Host-dependencies (host Dependent)<br>9. Service-templates<br>Ten. Services<br>Advanced-services.<br>Servicegroups (considering that some servicegroups might being linked to Others)<br>Service-dependencies.<br><br>The existing profile is more granular separated by attributes, ensuring that only the corresponding configuration properties are in each configuration file<br><br>(2) syntax<br>Usage:<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c class-f/path/to/file [-x (1-5)] [-s]<br><br>Help:<br><br>Required<br><br>-c specify the class of items, wish to Import. must correspond to an nconf class<br>(E.G. "host", "service," "hostgroup", "checkcommand", "contact", "timeperiod" ...)<br><br>-f the path to the file which are to be imported. Caution:make sure you have<br>Only items of one class in the same file (E.G. "hosts.cfg", "services.cfg" ...)<br>Also Make sure you import host-or service-templates separately ("host" or<br>"service" items containing a "name" Attribute)<br><br>Optional<br><br>-x Set a custom loglevel (1 = lowest, 5 = most Verbose)<br><br>-s Simulate Only. Don't make a actual modifications to the Database.<br><br><strong><strong><span style="color:#ff0000;">#-s is test mode and does not insert any data into the database</span></strong></strong><br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c timeperiod-f/usr/local/nagios/etc/objects/timeperiods.cfg-s<br><br>(3) actual Combat<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c timeperiod-f/usr/local/nagios/etc/objects/timeperiods.cfg-s<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c misccommand-f/usr/local/nagios/etc/objects/misccommands.cfg- S<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c checkcommand-f/usr/local/nagios/etc/objects/ Checkcommands.cfg-s<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c contact-f/usr/local/nagios/etc/objects/contacts.cfg-s<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c contactgroup-f/usr/local/nagios/etc/objects/contactgroup.cfg -s<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c host-template-f/usr/local/nagios/etc/objects/ Host-template.cfg-s<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c host-f/usr/local/nagios/etc/objects/hosts.cfg-s<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c service-template-f/usr/local/nagios/etc/objects/ Service-template.cfg-s<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c service-f/usr/local/nagios/etc/objects/services.cfg-s<br>/var/www/html/nconf/bin/add_items_from_nagios.pl-c service-f/usr/local/nagios/etc/objects/localhost.cfg-s<br></span></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;"><br></span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;"><span style="font-size:14px;">six, Static file Modification function</span></span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;"><span style="font-size:14px;"><span style="font-family:‘黑体‘, SimHei;font-size:14px;">static_cfg The default path is</span></span></span> <span style="font-size:14px;font-family:‘黑体‘, SimHei;">/var/www/html/nconf/static_cfg</span></p></p><p><p><span style="font-size:14px;font-family:‘黑体‘, SimHei;">Create a test file</span></p></p><p><p><span style="font-size:14px;font-family:‘黑体‘, SimHei;">#echo "hello kjklsj111" >><span style="font-family:‘黑体‘, SimHei;font-size:14px;">/var/www/html/nconf/static_cfg/</span>test.txt</span></p></p><p><p><strong><span style="font-family:‘黑体‘, SimHei;font-size:14px;"><br></span></strong></p></p><p><p><strong><span style="font-family:‘黑体‘, SimHei;font-size:14px;">Page click Administration->edit Static config files, you will find a save and download button, directly edit the file and click Save can</span></strong><br></p></p><p><p><strong><span style="font-family:‘黑体‘, SimHei;font-size:14px;">650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M01/7C/7C/wKiom1bRVsqiFsVPAAExRD9GDpM237.png "title=" 777. PNG "alt=" wkiom1brvsqifsvpaaexrd9gdpm237.png "/></span></strong></p></p><p><p><strong><span style="font-family:‘黑体‘, SimHei;font-size:14px;"><br></span></strong></p></p><p><p>This article is from the "no technology madness" blog, Please be sure to keep this source http://s8576.blog.51cto.com/9510968/1745558</p></p><p><p>Open source Monitoring solution Nagios+cacti+pnp4nagios+nconf+ndoutils+nagvis (eight) nconf Installation</p></p></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.