sadmin.cfg

9 minute read

This page is under construction.

#----------------------------------------------------------------------------
# SADMIN - Configuration file v2.1 - Updated in April 2019
#
#   - Comment line MUST begin with an # in column 1
#   - Blank lines are ignored
#   - The Format is simple (NAME = VALUE), NAME must start in column 1
#   - These are the defaults values used by sadmin tools
#   - Most fields can be overriden on a script basis
#        Like SADM_ALERT_TYPE, SADM_MAIL_ADDR overriden at the top of script
#        See template sadm_template.sh and sadm_template-py as an example.
#   - If this file (sadmin.cfg) is not present when the 1st script is run,
#     then template file .sadmin.cfg will be copied to sadmin.cfg
#     If both file sadmin.cfg and .sadmin.cfg are not present default values
#     are used.
#----------------------------------------------------------------------------

#----------------------------------------------------------------------------
# This field indicate whether this host is a SADMIN [S]erver or a [C]lient.
# Valid value are : SADMIN [S]erver, SADMIN [C]lient, SADMIN [D]evelopement
# Used in various script to activate or deactivate some features/operations.
# IMPORTANT : Set this field accordingly, there can be only one SADMIN Server
#
# [D]evelopment Host Type is used only in 'sadm_client_housekeeping.sh' script.
#  - When SADM_HOST_TYPE is set to [C] then server dir. are deleted on client.
#  - When SADM_HOST_TYPE is set to [D] then server dir. are left untouched.
#----------------------------------------------------------------------------
SADM_HOST_TYPE = S

#----------------------------------------------------------------------------
# Your company name 
# This name that will appears in the heading of the web site and on 
# some report and email that SADMIN produce.
#----------------------------------------------------------------------------
SADM_CIE_NAME = Your Cie Name

#----------------------------------------------------------------------------
# This field specify the email address used by SADMIN Tools
# to send various email. For example, you can request that the log of
# a script be sent when an error occured or every time is it run.
# (See SADM_ALERT_TYPE later on)
# Multiple email can be specify, a comma must seperate each of them.
#----------------------------------------------------------------------------
SADM_MAIL_ADDR = batman@batcave.com

#----------------------------------------------------------------------------
# Default Option for sending Alert after a SCRIPT is ended
# Can be overridden by changing SADM_ALERT_TYPE at the top of template script.
# 0 = No Alert Sent     1 = On Error Only
# 2 = On Success Only   3 = Always send alert
#----------------------------------------------------------------------------
SADM_ALERT_TYPE = 1

#----------------------------------------------------------------------------
# Default Alert Group is 'default' (As defined in $SADMIN/cfg/alert_group.cfg)
# Group specified here, MUST exist in the $SADMIN/cfg/alert_group.cfg.
#
# Use in Script: 
#   Default Alert Group use for sending alert within your script.
#   Default can be overridden by changing 'SADM_ALERT_GROUP' variable at the 
#   top of the script.
#
# Use by System Monitor 
#   When the System Monitor detect something that it could monitor (Like a 
#   new filesystem), a new monitoring line is added with this Alert group.
#   Default can be overridden by changing the Warning Alert Group (Column J) 
#   and the Error Alert Group (Column K), in the System Monitor configuration 
#   file of the system ($SADMIN/cfg/`hostname -s`.smon).
#
#----------------------------------------------------------------------------
SADM_ALERT_GROUP = default

#----------------------------------------------------------------------------
# TEXTBELT SMS TEXT MESSAGE VARIABLE
# This is the key generated by TextBelt and the URL to use the SMS Service
# Go to https://textbelt.com/ and press the 'Generate my key' button.
# Enter your email address and decide what is the right plan for you.
# It's $10 for 250 Text Messages, $20 for 600, $40 for 1200.
#----------------------------------------------------------------------------
SADM_TEXTBELT_KEY = 967e5a9315d22dddd8f33a5b645ab0a855900f042NFZPGjohx1JnCrjsd64hd52k9
SADM_TEXTBELT_URL = https://textbelt.com/text

#----------------------------------------------------------------------------
# Number of seconds to wait before the same alert is sent again within 
# the same day.
#
# This number can range from 0 to 85800 ((86400=24Hrs)-(600=10Min))=85800).
# For example, if you set this variable to 43200 seconds, it means that if 
# event of the alert is not solve in the next 12hrs, an alert will be sent 
# again after 12hrs (43200 Sec.) and this will be the last one.
# Alert older that 24 Hrs are skipped and do not generate an alert.
#
# Default is 0 to have only one alert per day for the same event.
#
# Note that if the problem is not solved the next day a new alert is sent
# approximately at the same time the first one was.
# If you don't want the alert to repeat the next day, you need to :
#  - For sysmon alert, correct the problem or change the test line in 
#    `hostname.smon` file.
#  - For alert coming from script, correct the problem and re-run the script
#    or change the Result Code to '0' on the last column of the last line in 
#    the corresponding rch file.
# 
#----------------------------------------------------------------------------
SADM_ALERT_REPEAT = 0

#----------------------------------------------------------------------------
# SADMIN Server - (MUST be fully qualified name)
# This name MUST NOT be an alias in the DNS
# It MUST be the result of the 'hostname' command on the SADMIN server
#----------------------------------------------------------------------------
SADM_SERVER = holmes.maison.ca

#----------------------------------------------------------------------------
# Standard Port for SSH is 22 - But if you use a different port put it here
#----------------------------------------------------------------------------
SADM_SSH_PORT = 32

#----------------------------------------------------------------------------
# Location of the rrdtool binary (Round Robin Database Tool)
# Used to record and produce performance statistics.
#----------------------------------------------------------------------------
SADM_RRDTOOL = /bin/rrdtool

#----------------------------------------------------------------------------
# Default Domain when Adding new server to SADM Tools
#----------------------------------------------------------------------------
SADM_DOMAIN = maison.ca

#----------------------------------------------------------------------------
# This is the user and group that have access to $SADM_BASE_DIR (/sadmin)
# sadm_housekeeping_client.sh and sadm_housekeeping_server.sh will use them
# to make sure all files and directories belong to them. 
#----------------------------------------------------------------------------
SADM_USER = sadmin
SADM_GROUP = sadmin

#----------------------------------------------------------------------------
# This is the user and group that run the apache server. 
# Do a 'ps -ef | grep -Ei "httpd|apacahe2"' & look at the name in column one,
# for the user name (SADM_WWW_USER).
# And give the same name to the group name (SADM_WWW_GROUP).
# sadm_housekeeping_server.sh will use them to make sure all files and
# directories belong to them.
# They should be set to the user and group that is running the http server.
# On RedHat/CentOS it is usually apache/apache
# On Ubuntu/Debian/Raspbian,LinuxMint it is usually www-data/www-data
#----------------------------------------------------------------------------
SADM_WWW_USER  = apache
SADM_WWW_GROUP = apache

#----------------------------------------------------------------------------
# MARIADB/MYSQL DATABASE PARAMETERS
#----------------------------------------------------------------------------
SADM_DBNAME     = sadmin
SADM_DBHOST     = sadmin.maison.ca
SADM_DBPORT     = 3306
SADM_RW_DBUSER  = rw_password
SADM_RO_DBUSER  = ro_password

#----------------------------------------------------------------------------
# SADM_MAX_LOGLINE is the maximum number of lines that each log can have.
#   - The default value is 500 lines.
#   - The Log filename is  "[HOSTNAME]_sadm_[NAME_OF_SCRIPT].log"
#   - They are located in ${SADMIN}/log directory.
#   - Log are created/updated automatically when you use the SADMIN Library.
#   - Log are automatically trimmed to this number at the end of the script.
#   - By Default the value below will is use.
#   - If you want a different value, change the line below in your script.
#
# In Shell Script:
#   export SADM_MAX_LOGLINE = 500  # When Script End Trim log to 500 Lines
#
# In Python Script:
#   instance.cfg_max_logline = 500 # When Script End Trim log to 500 Lines
#
#----------------------------------------------------------------------------
SADM_MAX_LOGLINE = 500

#----------------------------------------------------------------------------
# SADM_MAX_RCHLINE is the maximum number of lines that '*.rch' file can have.
#   - [R]esult [C]ode [H]istory file, record script execution history.
#   - The RCH filename are "[HOSTNAME]_sadm_[NAME_OF_SCRIPT].rch"
#   - They are located in ${SADMIN}/dat/rch directory.
#   - RCH file are automatically trimmed to this number when script end.
#   - RCH file are created/updated each time the script start and end.
#   - By Default the value below will is use.
#   - If you want a different value in a script, you can do the following ;
#
# In Shell Script:
#   export SADM_MAX_RCHLINE  = 35  # When Script End Trim log to 35 Lines
#
# In Python Script:
#   instance.cfg_max_rchline = 35  # When Script End Trim log to 35 Lines
#
#   If you wish not to use the RCH file in one of your script 
#   (Interactive Script for Example). 
#   Then you would change the variable below in the SADMIN section.
#
# In Shell Script : 
#   export SADM_USE_RCH="N"         # Don't generate entry in RCH file
#
# In Python Script : 
#   Instance.use_rch = False        # Don't generate entry in RCH file
#
#----------------------------------------------------------------------------
SADM_MAX_RCHLINE = 35

#----------------------------------------------------------------------------
# SADM_NMON_KEEPDAYS is the number of days we want to keep a nmon file in
# $SADMIN/dat/nmon directory.
#
#   - The "sadm_housekeeping_client.sh" script run automatically every day
#     and delete any nmon files older that the number of days specified.
#   - Default value of 60 days, is a reasonable default (each file is 500k).
#
# NMON file is an ASCII file created by the 'nmon' program that store system
# performance data. Normally one NMON file is produced daily by each system.
#   - NMON file are recorded in $SADMIN/dat/nmon directory.
#   - The name of each nmon file is "[HOSTNAME]_[yymmdd]_[hhmm].nmon"
#   - The Home page of nmon is http://nmon.sourceforge.net/pmwiki.php
#   - SADMIN setup script will install 'nmon' if not present on your system,
#     but it is usually include in the distribution repository.
#   - You can find a copy of nmon for your env. in ${SADMIN}/pkg/nmon dir.
#   - SADM Tool use nmon file to record performance data in RRD File.
# -----
# Once a day the nmon directory ($SADMIN/dat/nmon) of each clients is sync 
# (rsync) to the SADMIN server. 
# This is done daily by the "sadm_server_sunrise.sh" script that run early 
# in the morning (etc/cron.d/sadm_server).
# At midnight the current nmon file is closed and a new one created.
#----------------------------------------------------------------------------
SADM_NMON_KEEPDAYS = 40

#----------------------------------------------------------------------------
# Variable SADM_RCH_KEEPDAYS indicated the number of days we wait, until we
# deleted a RCH file that was not updated for the number of days specified.
#   - Recommended value is 60 days.
#   - The RCH files are located in ${SADMIN}/dat/rch directory.
#   - We don't want an unused/oudated RCH file to stay there for ever.
#
# If an RCH is not updated for a long time, this may indicate that the 
# associated script don't exist anymore or as not been run for a while. 
#----------------------------------------------------------------------------
SADM_RCH_KEEPDAYS = 40

#----------------------------------------------------------------------------
# The LOG files are updated every time the associate script is run.
# The LOG files are located in ${SADMIN}/log directory.
# If an LOG is not updated for a long time, this may indicate that the
# associated script don't exist anymore and as not been run for a while.
# The LOG file will may stay there for ever.
# The variable SADM_LOG_KEEPDAYS indicated the number of days we wait, till we
# deleted a LOG file that was not updated for the number of days specified.
# Recommended value is 60 days.
#----------------------------------------------------------------------------
SADM_LOG_KEEPDAYS = 40

#----------------------------------------------------------------------------
# NFS Server name where the Rear Backup are Stored
# NFS mount point where the Rear Backup are stored on the NFS Server
# Number of Rear Backup to keep at all time.
#----------------------------------------------------------------------------
SADM_REAR_NFS_SERVER        = batnas.maison.ca
SADM_REAR_NFS_MOUNT_POINT   = /volume1/backup_rear
SADM_REAR_BACKUP_TO_KEEP    = 3

#----------------------------------------------------------------------------
# Backup Script (sadm_backup.sh) to NFS or Local mount point 
#----------------------------------------------------------------------------
SADM_BACKUP_NFS_SERVER      = batnas.maison.ca
SADM_BACKUP_NFS_MOUNT_POINT = /volume1/backup_linux

# Backup to keep per type of backup
SADM_DAILY_BACKUP_TO_KEEP   =   4
SADM_WEEKLY_BACKUP_TO_KEEP  =   3
SADM_MONTHLY_BACKUP_TO_KEEP =   3
SADM_YEARLY_BACKUP_TO_KEEP  =   2

# Day to do a weekly backup (1=Mon,2=Tue,3=Wed,4=Thu,5=Fri,6=Sat,7=Sun)
SADM_WEEKLY_BACKUP_DAY      =   5     
# Date in the month to do a Monthly Backup Date (1-28)             
SADM_MONTHLY_BACKUP_DATE    =   1    
# Month and Date When to do a Yearly Backup Month
SADM_YEARLY_BACKUP_MONTH    =   12
SADM_YEARLY_BACKUP_DATE     =   31

#----------------------------------------------------------------------------
# NFS Server, mount point and Number of Mksysb backup to keep 
#----------------------------------------------------------------------------
SADM_MKSYSB_NFS_SERVER      = batnas.maison.ca
SADM_MKSYSB_NFS_MOUNT_POINT = /volume1/mksysb
SADM_MKSYSB_BACKUP_TO_KEEP  = 2

#----------------------------------------------------------------------------
# Network that we want to scan daily and have HostName Discover (DNS)
# and Mac Address
#----------------------------------------------------------------------------
SADM_NETWORK1 = 192.168.1.0/24
SADM_NETWORK2 = 
SADM_NETWORK3 =
SADM_NETWORK4 =
SADM_NETWORK5 =