below is my config file for monitoring system and i want to change string on below file preferrable via linux bash.
i want to scan complete file and look for default_not_os_not_oracle block and then change where i see testemail string to alertmail in default_not_os_not_oracle block only. i dont mind getting help in solution on python/perl/sed/awk way
#<!-- language: lang-xml -->
<instance:default_oracle>
<map>
/ora.*
/arch.*
</map>
<mail>
<to> %DBA% </to>
</mail>
</instance>
<instance:default_not_os_not_oracle>
<map> (?!/$|/users|/auto|/dev|/tmp|/var|/ora|/arch).* </map>
<action> mail </action>
<mail>
<to> testemail </to>
</mail>
</instance>
<instance:diskmon>
<warn>
<ge> 75 </ge>
<action> mail </action>
</warn>
<crit>
<ge> 90 </ge>
<action> page,mail </action>
</crit>
<map>
/apps
</map>
<mail> <to> abc@gmail.com </to> </mail>
<page> <to> abc@gmail.com </to> </page>
</instance>
#