NAME:Description:server_regex:Customer:
Rows starting with a # are considered as comments.
The definitions are processed in the sequence as listed in the configuration file. If a regular expression ( server_regex ) matches, the remaining definitions are not processed any more.
To test if a regular expression is working as expected, the command:
server_environment -s hostname
or
echo hostname | egrep "server_regex"
can be used.
Be aware, that the output of hostname(1) is checked against the server_regex when server_environment is called without the -s options.
This configuration file defines the six environments PRODUCTION, PREPRODUCTION, TEST, MAINTENANCE, BACKUP_BE and BACKUP_BB and is used in normal operations:
# # etc/server_environment.cfg - cfg for server_environment in NORMAL OPERATION # etc/server_environment.cfg.NORMAL_OPERATION - cfg for server_environment in NORMAL OPERATION # # [00] 24.07.2004 CWa Initial Version # # # Format: # <NAME>:<Description>:<server_regex>:<Customer>: # PRODUCTION:GDC Bern, new PRODUCTION Environment:dcdbsi(2[0-1]|3[0-3]):ACME: PREPRODUCTION:GDC Balsberg, new PREPRODUCTION Environment:dcdbsi(50|6[1-2]|7[1-2]):ACME: TEST:GDC Balsberg, new TEST Environment:dcdbsi(6[3-4]|7[3-4]):ACME: MAINTENANCE:GDC Balsberg, new MAINTENANCE Environment:dcdbsi(60|70):ACME: BACKUP_BE:GDC Bern, BACKUP Environment:dcdbsi(05|10|4[0-1]):ACME: BACKUP_BB:GDC Balsberg, BACKUP Environment:dcdbsi(5[1-2]|8[0-1]):ACME:
This configuration file defines the five environments PRODUCTION, TEST, MAINTENANCE, BACKUP_BE and BACKUP_BB and is used in a disaster case situation. This file replaces the file in example 1) during a disaster recovery where the PREPRODUCTION servers are used to host the PRODUCTION services.
Therefore the PREPRODUCTION definition disappeared and the PRODUCTION definition now contains the server_regex of the former PREPRODUCTION.
# # etc/server_environment.cfg - cfg for server_environment in a DISASTER CASE # etc/server_environment.cfg.DISASTER_CASE - cfg for server_environment in a DISASTER CASE # # [00] 24.07.2004 CWa Initial Version # # # Format: # <NAME>:<Description>:<server_regex>:<Customer>: # PRODUCTION:GDC Balsberg, DISASTER CENTER Environment:dcdbsi(50|6[1-2]|7[1-2]):ACME: TEST:GDC Balsberg, new TEST Environment:dcdbsi(6[3-4]|7[3-4]):ACME: MAINTENANCE:GDC Balsberg, new MAINTENANCE Environment:dcdbsi(60|70):ACME: BACKUP_BE:GDC Bern, BACKUP Environment:dcdbsi(05|10|4[0-1]):ACME: BACKUP_BB:GDC Balsberg, BACKUP Environment:dcdbsi(5[1-2]|8[0-1]):ACME:
Due to the fact that server_environment reads the config file edrc/etc/server_environment.cfg it makes sense to create a symbolic link to the active configuration file if a disaster recovery situation has to be covered:
[ /opt/edrc/etc ] [ root@dcdbsi30 ][*edrc*/bash]: ls -al server_environment.cfg* lrwxrwxrwx Jan 28 23:01 server_environment.cfg -> server_environment.cfg.NORMAL_OPERATION -rw-r--r-- Feb 28 16:59 server_environment.cfg.DISASTER_CASE -rw-r--r-- Apr 2 13:32 server_environment.cfg.NORMAL_OPERATION
See also hostlist(3) and hostlist.cfg(4) for more information about the special usage in a disaster case.
This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.