Chapter 10: configure notification

Source: Internet
Author: User
Tags snmp valid email address perl script
Chapter 10: configure notificationPurpose: to configure the notificationnotifiermngr resource type in notification, configure the resourceowner attribute, and Configure SNMP to accept the trap of VCs. Notification OverviewWhen VCs detects an event, you can notify:
1. generate an SNMP (V2) trap to the specified SNMP Console
2. send an e-mail message to the specified receiver VCs to ensure that no event information is lost when the VCs engine is running, even if the notifier process is stopped or not started. The had process runs through cluster communication to maintain a replicated message queue.
If a service group with a provisioning program is configured as a resource failure on one node, the provisioning program is failover to another cluster node. Because message queues are consistent and replicated when passing through nodes. The notification program can resume message transmission from where his failover stops to a new node.
The message is stored in the queue until one of the following conditions meets the requirements:
1. The notification program sends a confirmation message to had. At least one receiver must receive this message.
2. the queue is full and the queue is a loop-the final information (oldest) is deleted to write the latest (newest) information.
3. If the information in the queue cannot be transmitted to the receiver, it will be deleted in an hour.
Note: before the announcement program connects to had, the information is permanently stored in the queue until one of the last two conditions meets the requirements. Message Severity Level
Four levels:
1. Information: normal cluster activity. For example, resources are taken up and put online.
2. Warning: the cluster or resource is not modified as expected. For example, the resource is unknown.
3. error: the service is interrupted. For example, a service group fault cannot be failover.
4. severeerror: potential data crashes, for example,
The administrator can configure the notification to specify which recipients are sent information. The corresponding severity level is provided in the appendix based on the complete list of the previous event in the message severity level. Configure notification
When you can manually start and stop the notifier program outside VCs, you can make highly available notifier components by placing the daemon under the control of VCs.
The configuration steps are as follows:
1. Add a notifiermngr resource type to the cluster service group.
2. If SMTP announcement is required:
A. Modify the attributes of smtpserver and smtprecipients on notifiermngr.
B. Modify the resourceowner attribute on a single resource if you want.
C. You can also specify a groupowner email address for each service group.
3. If the SNMP announcement is required
A. Modify the resource type console attribute of SNMP notifiermngr
B. Configure the SNMP console to accept VCs trap
4. Modify the optional attributes of any notifiermngr resource type.
Manually start notifier
To test the notification component, you can start the notifier process from the command line on the cluster system. Note: When the notifier process is started from the command line, the notification cannot be controlled by VCs.
VCs notification is configured to enable the notifier daemon to bring the specified receiver and the corresponding severity level, for example:
Notifier-t m = smtp.acme.com, E = "admin@acem.com", L = warning Notifiermngr Resource Type
The notifier process can only run on a cluster system from a local had process. If notifier fails, notifiermngr agent detects the fault and the Migration Service Group includes notifiermngr resources to another system.
Because message queues are replicated across clusters, any system is specified as a service group with the same queue. When the notifiermngr resource is brought online, had sends a queuing message to the notifier process.
Add notifiermngr Resource
You can add them to the Service Group in the usual way.
1. Edit the main. cf file and restart VCs.
2. Use Gui
3. Hares command
Note: When modifying resource attributes, make sure the resource is offline and disabled. The notifier process must be stopped and the new parameters must be restarted for the modification to take effect.
The following are optional notifiermngr attributes:
Enginelisteningport: 14141
Note: This attribute is available for MySQL 3.5 and does not exist for MySQL 4.0.
Messagesqueue: 30
Notifierlisteningport: 14144
Snmpconsole: Fully Qualified SNMP console host name and Severity Level
Note: This is a required attribute. If SMTP is not specified
Snmpcommunity: Public
Snmptrapport: 162
Smtpfrompath: a valid email address
Smtpreturnpath: a valid email address
Smtpservertimeout: 10
Smtpservervrfyoff: 0 Configure resourceowner attributes
You can set resourceowner to define the owner of a resource. When a valid email address and notification are set for the attribute, an email message is sent to the defined receiver when a resource-related event occurs in these resources:
Resourcestateunknown
Resourcemonitortimeout
Resourcenotgoingoffline
Resourcewentonlinebyitself
Resourcefaulted
In addition to sending an email message, VCs also creates an item in the log file. For example:
2003/12/03 11:22:45 VCs info v-16-1-10304 resource file1 (owner = klaude, group testgroup) is offline on machine1
Resourceowner can be specified as an email ID (klaude@domain.com) or a user account (klaude). If a user account is specified, the email address
Built as login @ smtp_machine, smtp_machine is specified in the smtpserver attribute of notifiermngr Resource
Command modification:
Hares-Modify res_name resourceowner klaude configure the groupowner attribute
You can set groupowner to define the owner of a service group. When a valid email address and notification are set for the attribute, an email message is sent to the defined receiver when a group of related events occur in these groups:
Service Group causes a concurrency disturbance
The Service Group is faulty and cannot be failover.
Service Group online
Service Group offline
Service Group automatically disabled
Service Group restart
Service Group exchanged
The Service Group is restarting and responding to a permanent resource being brought up and launched.
In addition to sending an email message, VCs also creates an item in the log file. For example:
2003/12/03 11:22:45 VCs info v-16-1-10304 group SG1 (owner = klaude, group testgroup) is offline on system1
Command modification:
Hares-Modify grp_name groupowner klaude Configure the SNMP console to accept VCs Soft Interrupt (traps)
To enable an SNMP console to identify VCs traps, you must load the VCs MIB to the console. The original MIB are located at:/etc/vrtsvcs/snmp/VCs. MIB.
VCs SNMP configuration file:
/Etc/vrtsvcs/snmp/VCs. MIB
/Etc/vrtsvcs/snmp/vcs_trapd triggers
VCs provides an additional approach for reporting important events of system management. When VCs detects a specific event, you can set a trigger to notify the system administrator or perform other actions. You can use event triggers instead or combine them with announcements.
The trigger is an executable program, a batch processing file, or a Perl script located at $ vcs_home/bin/triggers. The script name must be a predefined event type supported by VCs.
Resfault
Resnotoff
Sysoffline
Postoffline
Postonline
For example, the resnotoff trigger is a Perl script named resnotoff at $ vcs_home/bin/triggers
Most triggers are configured (to be enabled) if the trigger program exists. No other configurations are required or possible. Each system must have a script in the cluster.
These triggers are applied to the entire cluster. For example, the resfault application applies to all resources and runs on the cluster.
Some triggers are enabled using one attribute. For example:
1. preonline: If the preonline attribute is set to 1 for the Service Group, the preonline trigger is run as part of the online process and brought online by the Service Group.
2. resstatechang: If the resstatechang trigger attribute is set to 1 for a service group, the resstatechang trigger is enabled for this service group.
The types of these triggers in the $ vcs_home/bin/triggers directory also have corresponding scripts. From: http://hi.baidu.com/nitar/blog/item/b1a0b828e1f7f2f299250aab.html
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.