Skip to content

Add server to database

Go to Automation

View in GitLab

Description

This script adds a server to a database by parsing various arguments such as database details, server information, and configuration settings. It connects to the database, checks if the server already exists, and inserts or updates records in multiple tables (tblItems, tblConfig, tblIP, lnkConfigBuPolicy). The script also sets specific attributes based on the provided arguments, such as operating system, environment, and backup policy. It ensures that physical devices are recorded and virtual servers are appropriately handled. The script concludes by committing the changes to the database.

Credentials

  • DG_ServersUser1 (SQL account)

Input

Variable Description
databaseserver Hostname for the database
databaseuser User for the database
databasepassword Password for the database
database SQL server database name
server Servername
domain domain
os Operating System
hwid Either the Hardware ID (serial number) or \'virtueel\'
hwtype The Hardware Type (manufacturer and model)
hwpurchasedate Date of purchase
ior IOR number
datacenter Either \'AC Zuid\' or \'Digipolis\'
data_prio Datastore priority
omgeving Either \'DV\',\'QA\' or \'PR\'
ip IP address
gateway IP gateway
nagios Wheter to monitor the server in Nagios (1) or not (0)
nagios_host_prio Priority in Nagios => 0 (Wachtdienst 24/7), 1 (Wachtdienst 7u-23u), 2 (Standaard monitoring) of 3 (Low-level monitoring)
auto_cat Automation category
team Team as defined in HEAT
beheerder Manager at Systeembeheer
contactpersoon Contact person for this server
klantid Organization, bvb. Groep Gent, OCMW, Digipolis,...
commentaar Internal comments related to this server
description Public description of the server usage
maint_automatic Wheter automatic maintenance may be applied (bool)
maint_dag Automatic maintenance: day of the week
maint_week Automatic maintenance: weeknumber of the month
maint_start Automatic maintenance: starting hour
butype Backup type

Output

updates database "Sql_db_dg_servers"

Dependencies