<commit_before># docker-monitoring-zabbix-agent
Note: currently in development, so might be some issues that need resolving.

Dockerized Zabbix agent that is able to monitor both docker containers and the host. Full configuration file can be given to the container to run zabbix agent. 

Monitors following docker stats:

* CPU
* Memory
* Disk space used by container
* Incoming and outgoing network traffic
* Container status
* Container uptime
* Container count

It is recommended that containers in the monitored host have a name defined. Otherwise the docker generated name is used and the history data will be lost every time the container is created again.

# Usage:

## General usage:

You can use the docker container to monitor the host by providing it necessary access to the monitored files/logs or systems. You need to enable these via mounting needed paths and make sure they are usable for the docker. Then configure the agent and Zabbix as you would normally. The docker agent monitors host system out of the box (testing needed still).

## Using full configure file and including files for Zabbix agent use:
Copy a configuration file called zabbix_agentd.conf into the conf/ folder. You can also copy any files such as certificates or other files under the conf/ file and reference them with the zabbix_agentd.conf as /data/conf/<filepath>.

An example configuration file can be found here: https://github.com/digiapulssi/docker-monitoring-zabbix-agent/blob/NAKKI-844/conf/zabbix_agentd.conf

```
docker run --name docker-monitoring-zabbix-agent \
-v `pwd`/conf:/conf \
-v /var/run/docker.sock:/var/run/docker.sock \
-d docker-monitoring-zabbix-agent
```

Socket is needed for monitoring containers. As said, you can modify the mount points how ever you like to suite your monitoring needs.

## Using environment parameters:

The container contains internal configuration file which is used if a full configuration is not given inside the conf/zabbix_agentd.conf. The if a configuration file is given, any ZBX_ prefixed environment variables have no effect, since the configuration is overwritten completely.

```<commit_msg>Updated information about environment variables<commit_after># docker-monitoring-zabbix-agent
Note: currently in development, so might be some issues that need resolving.

Dockerized Zabbix agent that is able to monitor both docker containers and the host. Full configuration file can be given to the container to run zabbix agent. 

Monitors following docker stats:

* CPU
* Memory
* Disk space used by container
* Incoming and outgoing network traffic
* Container status
* Container uptime
* Container count

It is recommended that containers in the monitored host have a name defined. Otherwise the docker generated name is used and the history data will be lost every time the container is created again.

# Usage:

## General usage:

You can use the docker container to monitor the host by providing it necessary access to the monitored files/logs or systems. You need to enable these via mounting needed paths and make sure they are usable for the docker. Then configure the agent and Zabbix as you would normally. The docker agent monitors host system out of the box (testing needed still).

## Using full configure file and including files for Zabbix agent use:
Copy a configuration file called zabbix_agentd.conf into the conf/ folder. You can also copy any files such as certificates or other files under the conf/ file and reference them with the zabbix_agentd.conf as /data/conf/<filepath>.

An example configuration file can be found here: https://github.com/digiapulssi/docker-monitoring-zabbix-agent/blob/NAKKI-844/conf/zabbix_agentd.conf

```
docker run --name docker-monitoring-zabbix-agent \
-v `pwd`/conf:/conf \
-v /var/run/docker.sock:/var/run/docker.sock \
-d docker-monitoring-zabbix-agent
```

Socket is needed for monitoring containers. As said, you can modify the mount points how ever you like to suite your monitoring needs.

## Using environment parameters:

The container contains internal configuration file which is used if a full configuration is not given inside the conf/zabbix_agentd.conf. You can additionally still define the environment variables to overwrite some configurations, for e.g. the case where there is need to customise the premade configuration easily for different installations.

```
{'fraction_non_alphanumeric': 0.051850159890360896, 'fraction_numerical': 0.0013704888076747374, 'mean_word_length': 4.522068095838588, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2508652', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1075, 'n_words': 596}