<commit_before># zaipcs

[Zabbix](http://www.zabbix.com)
[loadable module](https://www.zabbix.com/documentation/3.2/manual/config/items/loadablemodules)
for monitoring
[System V](https://en.wikipedia.org/wiki/UNIX_System_V)
[IPC](https://en.wikipedia.org/wiki/Inter-process_communication)
facilities

## summary

This module tries to mimic
[`ipcs`](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ipcs.html) utility.
It can read various information about
[shared memory segments](https://en.wikipedia.org/wiki/Shared_memory#Support_on_Unix-like_systems),
[message queues](https://en.wikipedia.org/wiki/Message_queue#Implementation_in_UNIX)
and
[semaphore](https://en.wikipedia.org/wiki/Semaphore_(programming)) sets
given IPC object identifier.
On Linux it additionally supports
[low level discovery](https://www.zabbix.com/documentation/3.2/manual/discovery/low_level_discovery).

## compile

[Download](http://www.zabbix.com/download)
Zabbix source or check it out from
[SVN repository](https://www.zabbix.org/websvn/wsvn/zabbix.com?):
`svn checkout svn://svn.zabbix.com/branches/3.2`

> Any version higher than 2.2 (when loadable module support was added) will do. But you need to compile module using sources of the version you will be using it with!

Place module source folder in Zabbix source tree `src/modules/` alongside `dummy`.

Run `make` to build, it should produce `zaipcs.so`.

## install

Copy `zaipcs.so` it to a desired location, set up necessary permissions.

## configure

Set `LoadModulePath` and `LoadModule` parameters in Zabbix
[agent](https://www.zabbix.com/documentation/3.2/manual/appendix/config/zabbix_agentd) /
[proxy](https://www.zabbix.com/documentation/3.2/manual/appendix/config/zabbix_proxy) /
[server](https://www.zabbix.com/documentation/3.2/manual/appendix/config/zabbix_server) configuration file.

Restart Zabbix agent / proxy / server.

## use

Configure checks: use item type
[_Simple check_](https://www.zabbix.com/documentation/3.2/manual/config/items/itemtypes/simple_checks)
if the module is loaded by server or proxy;
use item type
[_Zabbix agent_ or _Zabbix agent (active)_](https://www.zabbix.com/documentation/3.2/manual/config/items/itemtypes/zabbix_agent)
if the module is loaded by agent.

### supported item keys

- [x] __`ipcs-shmem-details[id,mode,option]`__ - mimics `ipcs --shmems --id ...`

__`id`__ - shared memory segment identifier

`mode`        | `option`                             | result
--------------|--------------------------------------|--------------------------------------<commit_msg>improved formatting<commit_after># zaipcs

[Zabbix](http://www.zabbix.com)
[loadable module](https://www.zabbix.com/documentation/3.2/manual/config/items/loadablemodules)
for monitoring
[System V](https://en.wikipedia.org/wiki/UNIX_System_V)
[IPC](https://en.wikipedia.org/wiki/Inter-process_communication)
facilities

## summary

This module tries to mimic
[`ipcs`](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ipcs.html) utility.
It can read various information about
[shared memory segments](https://en.wikipedia.org/wiki/Shared_memory#Support_on_Unix-like_systems),
[message queues](https://en.wikipedia.org/wiki/Message_queue#Implementation_in_UNIX)
and
[semaphore](https://en.wikipedia.org/wiki/Semaphore_(programming)) sets
given IPC object identifier.
On Linux it additionally supports
[low level discovery](https://www.zabbix.com/documentation/3.2/manual/discovery/low_level_discovery).

## compile

[Download](http://www.zabbix.com/download)
Zabbix source or check it out from
[SVN repository](https://www.zabbix.org/websvn/wsvn/zabbix.com?):
`svn checkout svn://svn.zabbix.com/branches/3.2`

> Any version higher than 2.2 (when loadable module support was added) will do. But you need to compile module using sources of the version you will be using it with!

Place module source folder in Zabbix source tree `src/modules/` alongside `dummy`.

Run `make` to build, it should produce `zaipcs.so`.

## install

Copy `zaipcs.so` it to a desired location, set up necessary permissions.

## configure

Set `LoadModulePath` and `LoadModule` parameters in Zabbix
[agent](https://www.zabbix.com/documentation/3.2/manual/appendix/config/zabbix_agentd) /
[proxy](https://www.zabbix.com/documentation/3.2/manual/appendix/config/zabbix_proxy) /
[server](https://www.zabbix.com/documentation/3.2/manual/appendix/config/zabbix_server) configuration file.

Restart Zabbix agent / proxy / server.

## use

Configure checks:
* use item type
[_Simple check_](https://www.zabbix.com/documentation/3.2/manual/config/items/itemtypes/simple_checks)
if the module is loaded by server or proxy;
* use item type
[_Zabbix agent_ or _Zabbix agent (active)_](https://www.zabbix.com/documentation/3.2/manual/config/items/itemtypes/zabbix_agent)
if the module is loaded by agent.

### supported item keys

- [x] __`ipcs-shmem-details[id,mode,option]`__ - mimics `ipcs --shmems --id ...`

__`id`__ - shared memory segment identifier

`mode`        | `option`                             | result
--------------|--------------------------------------|--------------------------------------
{'fraction_non_alphanumeric': 0.1622670807453416, 'fraction_numerical': 0.010869565217391304, 'mean_word_length': 3.9076190476190478, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 26, 'lorem ipsum': 0, 'www.': 20, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '436121', 'n_tokens_mistral': 1716, 'n_tokens_neox': 1633, 'n_words': 377}