04-05-2013 08:18 AM
Hi,
I need to make a very minor edit to the main.cf file. I am assuming this is the way to do this:
haconf -makerw
edit main.cf on one of the nodes i.e vi /etc/VRTSvcs/conf/config/main.cf
save changes
hacf -verify /etc/VRTSvcs/conf/config
haconf -dump -makero
Solved! Go to Solution.
04-05-2013 10:40 AM
SmtpRecipients is an association, so unless using the -add/-update flag, modify both/all the key-value pairs in one step or the first one will be overwritten with the second/last (see hares -help -modify or hares manpage, eg: https://sort.symantec.com/public/documents/sfha/6.0.1/solaris/manualpages/html/man/cluster_server/html/man1m/hares.1m.html )
so:
# haconf -makerw
# hares -modify notifier SmtpReturnPath xyz@domain.com
# hares -modify notifier SmtpFromPath xyz@domain.com
# hares -modify notifier SmtpRecipients xyz@domain.com Warning abc@domain.com Error
# haconf -dump -makero
The notifier resource is already Enabled, so you don't need to re-enable it (check: # hares -display notifier -attribute Enabled )
04-05-2013 09:18 AM
Using your procedure to edit main.cf would lose your changes (ie: it won't work, so don't do it).
If you need to edit main.cf manually, you need to stop VCS
# hastop -all -force ### stops vcs but leaves resources up. Wouldn't recommend doing this in the middle of the day though.
Then edit the main.cf
Verify the configuration:
# hacf -verify /etc/VRTSvcs/conf/config
Start vcs on the node where you made the edits (or ensure you have copied the changed file to all nodes)
# hastart
once vcs is started, start vcs on the remaining nodes.
***** Suggestion *****
What type of "minor edit" is required? Most changes can be done dynamically with hares/hagrp/haxxxxx -modify
eg: to change a resource attribute
# haconf -makerw
# hares -modify <resource> <attribute> <new_value>
# haconf -dump -makero
The latter method is preferable, obviously, unless it is something that cannot be changed without stopping the daemon.
04-05-2013 09:39 AM
further reading that may be of use:
VCS 6.0 (Solaris) Administrator's Guide: https://sort.symantec.com/public/documents/vcs/6.0/solaris/productguides/html/vcs_admin/
Section 1: Clustering concepts and terminology -> VCS configuration concepts -> About configuring VCS
https://sort.symantec.com/public/documents/vcs/6.0/solaris/productguides/html/vcs_admin/ch03s01.htm
----------
In a VCS cluster, the first system to be brought online reads the configuration file and creates an internal (in-memory) representation of the configuration. Systems that are brought online after the first system derive their information from systems that are in the cluster.
You must stop the cluster if you need to modify the files manually. Changes made by editing the configuration files take effect when the cluster is restarted. The node where you made the changes should be the first node to be brought back online.
----------
and VCS configuration language: https://sort.symantec.com/public/documents/vcs/6.0/solaris/productguides/html/vcs_admin/ch03s02.htm
----------
Several ways to generate configuration files are as follows:
• Use the Web-based Veritas Operations Manager.
• Use Cluster Manager (Java Console).
• Use the command-line interface.
• If VCS is not running, use a text editor to create and modify the files.
• Use the VCS simulator on a Windows system to create the files.
----------
pdf version and other assorted VCS guides available here: https://sort.symantec.com/documents/doc_details/vcs/6.0/Solaris/ProductGuides/
or go to https://sort.symantec.com/documents to pick the correct platform/version combination if different to above.
04-05-2013 09:49 AM
I prefer your method of using hares -
Here is what is currently in main.cf:
NotifierMngr notifier (
SmtpServer = "mailserver.domain.com"
SmtpReturnPath = "admin@domain.com"
SmtpFromPath = "admin@domain.com"
SmtpRecipients = { "admin@domain.com" = Warning,
"page-admin@domain.com" = Error }
)
I need to change admin@domain.com in SmtpReceipents for Error level to xyz@domain.com,
question: do I need to change SmtpReturnPath to the same also and the SmtpFromPath to the same thing? Are they usually the same?
So my code looks like this:
haconf -makerw
hares -modify notifier SmtpRecipients xyz@domain.com Error
hares -modify notifier SmtpReturnPath xyz@dmain.com
hares -modify notifier SmtpFromPath xyz@domain.com
hares -modify notifier Enabled 1
haconf -dump -makero
04-05-2013 10:28 AM
I could not respond to this post, asking a friend to do so
-Rick
I agree with using hares - modify
This is present snippet from main.cf
NotifierMngr notifier (
SmtpServer = "mailserver.domain.com"
SmtpReturnPath = "admin@domain.com"
SmtpFromPath = "admin@domain.com"
SmtpRecipients = { "admin@domain.com" = Warning,
"page-admin@domain.com" = Error }
)
I need to change admin@domain.com to xyz@domain.com and page-admin@domain.com to abc@domain.com
This is my code
haconf -makerw
hares -modify notifier SmtpRecipients xyz@domain.com Warning
hares -modify SmtpReceipents abc@domain.com Error
hares -modify notifier SmtpReturnPath xyz@domain.com
hares -modify notifier SmtpFromPath xyz@domain.com
hares -modify notifier Enabled 1
haconf -dump -makero
will it work???
04-05-2013 10:40 AM
SmtpRecipients is an association, so unless using the -add/-update flag, modify both/all the key-value pairs in one step or the first one will be overwritten with the second/last (see hares -help -modify or hares manpage, eg: https://sort.symantec.com/public/documents/sfha/6.0.1/solaris/manualpages/html/man/cluster_server/html/man1m/hares.1m.html )
so:
# haconf -makerw
# hares -modify notifier SmtpReturnPath xyz@domain.com
# hares -modify notifier SmtpFromPath xyz@domain.com
# hares -modify notifier SmtpRecipients xyz@domain.com Warning abc@domain.com Error
# haconf -dump -makero
The notifier resource is already Enabled, so you don't need to re-enable it (check: # hares -display notifier -attribute Enabled )
04-05-2013 11:20 AM
Thank you very much! I appreciate it.