How can I test the NotifierMngr without faulting a production resource?
book
Article ID: 100023139
calendar_today
Updated On:
Resolution
This is a command line workaround to test NotifierMngr will send an email when a resource faults. A dummy service group is created and also a dummy resource of type of FileNone. If the file does not exist the resource will fault and NotifierMngr should send an email from the server specified in SmtpServer.
Here is a basic example of a NotifierMngr resource configuration with a brief explanation of the resource attributes used.
NotifierMngr ntfr (
Critical = 0
SmtpServer = localhost
SmtpFromPath = "vcs_alert@your_company.com"
SmtpRecipients = { "user_to_be_notified@your_company.com" = Warning }
)
SmtpServer : Specifies the machine name of the SMTP server.
SmtpFromPath : Set to a valid email address, if you want the notifier to use a custom email address in the FROM: field. Type and dimension: string-scalar Example: "usera@example.com"
SmtpRecipients: Specifies the email address where SMTP sends information and the severity level of the messages. The severity levels of messages are Information, Warning, Error, and SevereError. Specifying a given severity level for messages indicates that all messages of equal or higher severity are received.
Create the dummy service group and resource:
# haconf -makerw
# hagrp -add dummySG
VCS NOTICE V-16-1-10136 Group added; populating SystemList and setting the Parallel attribute recommended before adding resources
# hagrp -modify dummySG SystemList
0 1
# hares -add dummyResource FileNone dummySG
# hares -modify dummyResource PathName /tmp/dummyfile
# haconf -dump
The service group would look like this in the main.cf file:
group dummySG (
SystemList = { primary_servername = 0, secondary_servername = 1 }
)
FileNone dummyResource (
Critical = 0
PathName = "/tmp/dummyfile"
)
Now enable the resource - it should fault immediately
# hares -modify dummyResource Enabled 1
The resource should fault and NotifierMngr should send an email to the SmtpRecipients immediately after the resource is enabled. A resource fault is considered a SevereError so the severity level of Warning specified in the NotifierMngr resource example would include this.
If the email has been sent and received then the test is complete - the dummyResource and dummySG can be deleted
# hares -delete dummyResource
# hagrp -delete dummySG
# haconf -dump -makero
Issue/Introduction
How can I test the NotifierMngr without faulting a production resource?
Was this article helpful?
thumb_up
Yes
thumb_down
No