Go to file
ermisw 88dc13db9c Initial Commit 2023-03-31 12:42:21 +02:00
.gitignore Initial Commit 2023-03-31 12:39:47 +02:00
change_hostmonitoring.py Initial Commit 2023-03-31 12:39:47 +02:00
environment.yaml Initial Commit 2023-03-31 12:39:47 +02:00
hosts.csv Initial Commit 2023-03-31 12:39:47 +02:00
readme.md Initial Commit 2023-03-31 12:42:21 +02:00
requirements.txt Initial Commit 2023-03-31 12:39:47 +02:00

readme.md

HOST MONITOR ACTIVATE/DEACTIVATE

This repository holds the code to activate or deactive host monitoring by using a list of host (csv)

Prerequisites

Python packages

Before executing scripts, python requirements have to be satisfied. To do so, execute following command: pip install -r requirements.txt

.env file

To provide authentication for API calls, create ".env" file in the script directory with following definition:

<ENV NAME>=<ENV TOKEN>
	<ENV NAME> is name of environment variable. This name should be passed to "environment.yaml" file as "env-token-name" parameter
	Example:
	environment.yaml file: "- env-token-name: "GLOBAL_CONFIG_TOKEN"
	.env file: "GLOBAL_CONFIG_TOKEN=XXXXXXXXXXX"

Usage for activating

python change_hostmonitoring.py -i hosts.csv --activate 

Usage for deactivating

python change_hostmonitoring.py -i hosts.csv --deactivate

format of the host csv list

HOSTID, ENVIRONMENT

example:

HOST-123,euprod HOST-345,naprod

additional files

createKeyRequestReport.py

This scripts generates the report.

environment.yaml

File containing environments to execute --auto-upload

Environment name:
	name: string										#name ov environment
	env-url: str										#url of environment
	env-token-name: str								#name of environment variable containing API token

requirements.txt

File containing required python packages