Analyzes the alarm control tasks and monitoring tasks of the Gigabit Ethernet switch. The two tasks of the alarm Group of the Gigabit Ethernet switch may not have a specific mode, therefore, the following alarm monitoring task Questions and Replies provided by netizens may not help you to obtain events. If no event exists, the operation is blocked.
An alarm group consists of two tasks: One alarm control task and one alarm monitoring task. When the SNMP agent performs operations on the MIB, an event is generated, which activates the alarm control task. The alarm control task performs the following operations:
◆ Get events. If no event exists, the operation is blocked.
Check whether a new alarm task is in by comparing the status parameter table with the alarm table. If yes, to initialize the new alarm task, first obtain the monitoring object alarm Variable of the alarm and check whether its identifier exists in the MIB, and whether the value is represented by the INTEGER type of ASN.1. Otherwise, monitoring cannot be performed.
Then add a node for the new alarm in the alarm status parameter table and create a timer for the alarm: If alarmSampleType is set to 1, the scheduled interval is set to alarmInterval; if the value of alarmSampleType is 2, the scheduled interval is set to alarmInterval/2.
The timed expiration function sends a message to the alarm group message queue. The message value is the index value of the alarm. Finally, read the value of the Monitored object in the MIB, save it to the alarmValue of the Gigabit Ethernet switch, and check whether the current value generates an alarm.
◆ Check whether a defined Gigabit Ethernet switch alarm is deleted. If yes, delete the corresponding timer and then delete the corresponding node in the alarm status parameter table.
The alarm monitoring task executes the following Gigabit Ethernet switch loop:
◆ Receive timer messages from the alarm message queue and obtain the Gigabit Ethernet switch alarm index from the messages;
◆ The monitored port and object identifier are obtained from the index in the alarm table, and the identifier reads the sample value in the MIB;
◆ Check whether the Gigabit Ethernet switch generates an alarm;
◆ Save the read value to alarmValue.