How to weekly maintenance

Contents
How To Notes
Command not found
If you received a message similar to command not found or no such file or directory you may need to set the environment variables for the shell by running the source /usr/local/groundwork/scripts/setenv.sh script. This works in each shell session and only in shells similar to the Bourne shell, like bash. It will not work in either csh or tcsh.
Required password
You will need to have the PostgreSQL postgres user password available to perform various commands. This is the same database password that was used for the GroundWork Monitor installation or upgrade.
Example file name
Throughout this document we refer to a <timestamp> format. For example 2014-02-05_14-06-10 would be the name of a backup directory or part of a backup file name representing the date and time of a backup.

1.0 Notify Users, Obtain Access, and Stop Services

1.1 Notify users
  • Before starting with any system maintenance you will need to notify GroundWork Monitor system users that the system will be unavailable for a short time and that they will need to log out otherwise they will receive error messages and will loose their current session. You can schedule a maintenance window to notify all system users.
1.2 Obtain Shell Access
  • Next, you will need to get shell access to the GroundWork server. You can do this either by opening a shell on the sever or get remote access with through ssh. Make sure that you are user root to execute all commands.
1.3 Stop Services
  • Stop all services used by GroundWork Monitor with their respective commands:
    service groundwork stop gwservices
    service groundwork stop nagios
    service groundwork stop apache
    service groundwork stop snmpttd
    service groundwork stop syslog-ng

2.0 Backup Databases and Configuration Settings

2.1 To back up GroundWork databases
  • Create a backup sub-directory in /usr/local/groundwork/.
    Backup directory
    This step is a one time action. Skip this step if you have already created a backup directory.
    cd /usr/local/groundwork
    mkdir backup
    chown nagios:nagios backup
  • Change your working directory to backup with the following command:
    cd /usr/local/groundwork/backup
  • Issue the following commands to backup all GroundWork databases:
    pg_dump -f gwcollagedb-<timestamp>.sql.tar -F t -c -E LATIN1 gwcollagedb
    pg_dump -f jboss-idm-<timestamp>.sql.tar -F t -c -E LATIN1 jboss-idm
    pg_dump -f jboss-jcr-<timestamp>.sql.tar -F t -c -E LATIN1 jboss-jcr
    pg_dump -f dashboard-<timestamp>.sql.tar -F t -c -E LATIN1 dashboard
    pg_dump -f monarch-<timestamp>.sql.tar -F t -c -E LATIN1 monarch
2.2 To back up system configuration settings
  • From the /usr/local/groundwork/backup directory, issue the following commands to backup the system configuration settings for Foundation and Nagios:
    tar -czf  foundation_config_backup.tar.gz /usr/local/groundwork/config/*
    tar -czf  nagios_config_backup.tar.gz /usr/local/groundwork/nagios/etc/*
2.3 To back up GroundWork Profiles
  • From the /usr/local/groundwork/backup directory, issue the following commands to backup GroundWork Profiles:
    tar -czf profiles_backup.tar.gz /usr/local/groundwork/core/profiles/*
2.4 To back up customized monarch modules
  • From the /usr/local/groundwork/backup directory, issue the following commands to backup customized Monarch modules:
    tar -czf monarch_callout_backup.tar.gz /usr/local/groundwork/core/monarch/lib/MonarchCallOut.pm
    tar -czf monarch_deploy_backup.tar.gz /usr/local/groundwork/core/monarch/lib/MonarchDeploy.pm
    tar -czf monarch_external_backup.tar.gz /usr/local/groundwork/core/monarch/lib/MonarchExternals.pm
2.5 To back up automation scripts and templates
  • From the /usr/local/groundwork/backup directory, issue the following commands to backup monarch automation scripts and templates:
    tar -czf automation_scripts_backup.tar.gz /usr/local/groundwork/core/monarch/automation/scripts/*
    tar -czf automation_templates_backup.tar.gz /usr/local/groundwork/core/monarch/automation/templates/*
2.6 To back up JBoss configuration files
  • JBoss configuration files are all stored in the directory: /usr/local/groundwork/config
    tar -czf jboss-config_backup.tar.gz /usr/local/groundwork/config/jboss/*
    tar -czf jboss-config-xml_backup.tar.gz /usr/local/groundwork/config/josso*.xml

3.0 Purge Old Backups

  • This step covers purging backup data that can be rotated. If you have decided to keep backups for more than a month issuing the following command will purge any backup files older than 28 days. Issue the following command from the /usr/local/groundwork/backup directory:
    find /usr/local/groundwork/backup/ -mtime +28 -exec /bin/rm -rf {} \;

4.0 Restart Services

  • Next, you will need to restart all services used by GroundWork Monitor with their respective commands:
    service groundwork start gwservices
    service groundwork start nagios
    service groundwork start apache
    service groundwork start snmpttd
    service groundwork start syslog-ng
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.