To monitor the CPU and memory of the switch, the key is to find the correct OID. For how to find the OID, please refer to the following blog post.
http://tryrus.blog.51cto.com/10914693/1788833
Before reading this blog post, please make sure that you have an understanding of the basic operation of zabbix. If you don't understand, you can read the blog post I wrote before.
http://tryrus.blog.51cto.com/10914693/1772271
http://tryrus.blog.51cto.com/10914693/1782062
First, the configuration environment
CentOS 7 Linux version 3.10.0-229.el7.x86_64
Zabbix-3.0.1
c2960s-universalk9-mz.122-55.SE5.bin
c2960s-universalk9-mz.122-55.SE3.bin
c2960-lanbasek9-mz.122-50.SE5.bin
c3750e-universalk9-mz.122-55.SE5.bin
2. CPU monitoring and configuration trigger
2.1 OIDs to be used
1.3.6.1.4.1.9.2.1.57.0 CPU utilization for one minute
1.3.6.1.4.1.9.2.1.58.0 CPU utilization for five minutes
1.3.6.1.4.1.9.2.1.56.0 CPU utilization for five seconds
2.2 Create Item
Since the CPU OIDs of different versions of Cisco are the same, you can create a new template Cisco CPU Utilization, create items to be monitored in this template, and finally add the template Cisco CPU Utilization to the templates of various types of switches, so that all The switch will automatically monitor the CPU usage.
Create three CPU-related items under the Cisco CPU Utilization template, CPU utilization for one minute, CPU utilization for five minutes, and CPU utilization for five seconds, as shown in the following figure.
The values of Name and Key can be filled in casually, but it is better to be like me, who can intuitively know what the item is monitoring
Type: SNMP v2 version
SNMP OID: Corresponding OID
SNMP community: the corresponding SNMP read community word
Units: CPU usage, fill in percent sign %
Other options can be defaulted, and the last item Description fills in the Description when looking up the OID on the Cisco website. Click Add to complete the item creation.
After creating three monitoring items of cpu usage, the following figure shows
2.3 Create Graph
In the template Cisco CPU Utilization, create a Graph, as shown in the following figure.
Fill in the Name of the Graph, add the three newly created items in the Items option, and click the last Add to complete the creation of the Graph.
2.4 Verify Graph
Add the created template Cisco CPU Utilization to the template of the switch, and then select a switch in Monitoring-->Graphs to view the CPU Utilization, as shown in the following figure.
2.5 Create Trigger
Trigger is also created in the template Cisco CPU Utilization, because all switches will be used.
Create the Trigger as shown in the image below.
The more important thing here is the expression, that is, when zabbix should use the trigger (Trigger) to alert the user to let the user know that the CPU usage is abnormal. Click Add behind Expression to add an expression, as shown in the following figure.
Item: Select CPU utilization for five seconds here. If the real-time CPU usage exceeds the alarm threshold, zabbix will send an alarm via email, so it is most appropriate to know the real-time CPU usage.
Function: Refers to the function, there is a drop-down list, select the average value greater than N from the drop-down list.
Last of(T): #3, the last three values
N: 20 Fill in 20 here, which means 20%, and the percent sign can be omitted. 20 is filled in here for the convenience of testing.
The final expression is {Cisco CPU Utilization:cpuUtilization5sec.avg(#3)}>20
The completed trigger is created, as shown in the following figure
For the detailed usage and function of expressions, you can refer to the following two documents.
https://www.zabbix.com/documentation/3.0/manual/config/triggers/expression
https://www.zabbix.com/documentation/3.0/manual/appendix/triggers/functions
2.6 Verify trigger
Because I set the switch's CPU usage above 20%, the trigger alarm will be triggered, so after a minute or so after the trigger is created, my email will receive the problem email shown in the figure below, indicating that the configuration has taken effect.
Then I adjusted the threshold from 20% to 80%. After a minute or so, I received the OK email as shown in the figure below, indicating that the configuration has taken effect again.
3. Memory monitoring and configuration trigger
3.1 OIDs to be used
.1.3.6.1.4.1.9.9.48.1.1.1.6.1 ciscoMemoryPoolFree
.1.3.6.1.4.1.9.9.48.1.1.1.5.1 ciscoMemoryPoolUsed
3.2 Create Item
Like CPU usage, after creating the template Cisco Memory Statistics, create Items ciscoMemoryPoolFree and ciscoMemoryPoolUsed in the template. The creation method is the same, but the memory item does not need to fill in the unit. Other options can be defaulted, and the last item Description fills in the Description when looking up the OID on the Cisco website. Click Add to complete the item creation.
After creating two monitoring items of memory, it is shown in the following figure
3.3 Create Graph
In the template Cisco Memory Statistics, create a Graph, as shown in the following figure.
Fill in the Name of the Graph, add the two newly created items in the Items option, and click the last Add to complete the creation of the Graph.
3.4 Verify Graph
Add the created template Cisco Memory Statistics to the template of the switch, and then select a switch in Monitoring-->Graphs to view the Memory Statistics, as shown in the following figure. Since memory rarely changes, it appears as a horizontal line in the graph.
3.5 Create Trigger
Trigger is also created in the template Cisco Memory Statistics, because all switches will be used.
Create a Trigger and click Add after Expression to add an expression, as shown in the following figure.
Here I set the threshold to 20%. First, according to the configuration shown in the above figure, add two expressions.
{Cisco Memory Statistics:ciscoMemoryPoolFree.last()}=0
{Cisco Memory Statistics:ciscoMemoryPoolUsed.last()}=0
After the addition is complete, it is shown in the figure below.
Modify the above expression to {Cisco Memory Statistics:ciscoMemoryPoolFree.last()}*0.8<{Cisco Memory Statistics:ciscoMemoryPoolUsed.last()}*0.2, as shown in the figure below, indicating that an alarm will be triggered when the idle usage is less than 20% .
That is, A<(A+B)*0.2 is converted to A*0.8<B*0.2
Click Add at the bottom to complete the creation of the trigger, as shown in the following figure.
3.6 Verify trigger
After the Trigger configuration is complete, zabbix will configure the operation. So after the trigger is created, after a minute or so, I received the OK email shown in the figure below, indicating that the configuration has taken effect.
As for the configuration threshold, the PROBLEM mail will be generated, I will leave it for you to watch and test~~