First, switch snmp configuration, the following is the configuration command of H3C 5500 series:
snmp-agent enablesnmp-agent community read publicsnmp-agent sys-info version allsnmp-agent group v1 publicsnmp -agent group v2c publicsnmp-agent group v3 publicsnmp-agent target-host trap address udp-domain <nagios server IP> params securityname public
Second, install and configure mrtg1, install MRTG, use yum default installation: Br>
[root@nagios ~]#yum -y install mrtg
2, create a configuration file, because I only need to monitor one core switch, so only create one, if there are multiple switches to monitor, then Create multiples in the same way as below:
[root@nagios ~]#mkdir /usr/local/nagios/mrtg ##Create a configuration file folder [root@nagios ~]#cfgmaker - Output=/usr/local/nagios/mrtg/mainswitch.cfg public@switch IP
3. Create and configure the folder for storing the traffic graph and html page. I put it under the nagios web file, such as:
[root@nagios ~]# mkdir /usr/local/nagios/share/mrtg[root@nagios ~]# vi /usr/local/nagios/mrtg/mainswitch.cfg find“WorkDir:
” Replace the trailing path with the previous step Create the path, note that if you are commented out by #, you need to cancel #, and after completion: WorkDir: /usr/local/nagios/share/mrtg
4, generate traffic graph:
[root@nagios ~]# env LANG=C /usr/bin/mrtg /usr/local/nagios/mrtg/mainswitch.cfg
This step may have a warning, no matter how many times he performs it Until there is no warning.
Use the task plan configuration to generate every 5 minutes:
[root@nagios ~]#vi /etc/crontab
Add the following line:
*/5 * * * * root /usr/bin/env LANG=C /usr/bin/mrtg /usr/local/nagios/mrtg/mainswitch.cfg
Restart the scheduled task using service crond restart.
Generating summary home page:
[root@nagios ~]# indexmaker -output=/usr/local/nagios/share/mrtg/index.html -title="MainSwitch Traffic Monitoring" /usr/Local/nagios/mrtg/mainswitch.cfg
At this point, you can use the browser to access the traffic map of MRTG production. The path is: http://server IP/nagios/mrtg/
IV. Configure Nagios Read the traffic information monitored by mrtg: In the latest version of nagios, there are check_mrtg and check_mrtgtraf plugins, and related commands have been configured and can be used directly. The specific methods are as follows:
1. Define switches and monitoring services: Br>
Edit vi /usr/local/nagios/etc/objects/switch.cfg, you can talk about the definition of the original switch, or modify it in the original configuration, the main content is as follows: define host:
define host{use generic-switchhost_name MainSwitchalias MainSwitchaddress Replace with switch IP address hostgroups switches}
Define server:
define service{use generic-servicehost_name MainSwitchservice_description Port 1 traffic check_command check_local_mrtgtraf!/usr/local/nagios/share/mrtg/replaced with switch IP_1.log!AVG!1000000,1000000!5000000,5000000!10}
Note: Behind the switch IP above The number 1 indicates switch port 1. To monitor more ports, define more services in the same way.
Restart the nagios service, refresh the nagios monitoring page, and wait for two minutes to see the traffic information.
If you want to view more information on port traffic map, you can access the MRTG page view, the path is: http: //nagiso server IP /nagios /mrtg /
Installing VMware in Linux System Due to the project needs, you need to virtuali
When I maintain the blog file today, I found that I cant delete some folders and files in the websi
view mysql default encoding format show variables like “character%”; If the reality-bash
Think about it, what if you want to change the size of an image to a smaller size? Of course, I will
Linux must learn 60 commands Daquan
Introduction to Linux File System Directory Structure
How to learn linux programming
Three tips for improving the efficiency of Linux operation and maintenance management
Linux kernel preemption implementation mechanism analysis
Compile vim to solve Chinese support
How popular is Ubuntu Linux? Data tells you
Two ways to install SUSE Linux10 system from hard disk
How to connect a Linux computer to the Internet with a cdma 1x phone
What should I do if the win10 mouse fails? Win10 mouse sensitivity adjustment method
Windows 10 9 annoying problems urgently need to be solved
Strengthen NT kernel protection to create a secure XP system
How to use Win_8.1 to make others difficult to crack
Win10 will natively support USB 3.1
What should I do if the Win10 system opens ANSYS and always stops working?
Win7 set window color mixer according to requirements tutorial
What should I do if the Win7 system cannot open the event viewer?
What should I do if the WinXP system prompts "Not a valid Win32 application" when opening a program?
Some of the skills you must master when using the Metro application under Win8.1