Writing your own agents/check plugins -> strings in check_mk checks 'info' list is splited in words

Hello,

I wrote an special agent to query Dell EMC ECS via api rest. I’m blocked and extreamly frustraded about not been able of passing string items to the “info” lists of lists of the checks without beeing splited into words.

Let me show you step by step

  1. I run my agent to query alerts on dell EMC ECS and prints out the following line (I separted each field using semicolons ‘;’)
<<<dellEcs_alerts>>>
2023-02-09T02:16:36;REPO Partial GC;Partial GC for user garbage is too slow. Please involve ECS engineering. RepoPartialGC;WARNING;;urn:storageos:Alert:33f5dedc-0186-128b-8d53-58fb1fcfd04a;True
2023-01-22T13:05:29;Quota;SoftQuotaLimitExceeded: Namespace es_XXX_xxxx;WARNING;es_fmg_avz2;urn:storageos:Alert:d9957764-0185-1be2-af88-c07662bb9bdb;True
```

2) I wrote one check to process data and show alerts in check_mk, but the "info" data structure is splited into words. It looks like it does not understand semicolons as field separators:
```
[u'2023-02-09T02:16:36;REPO', u'Partial', u'GC;Partial', u'GC', u'for', u'user', u'garbage', u'is', u'too', u'slow.', u'Please', u'involve', u'ECS', u'engineering.',u'RepoPartialGC;WARNING;;urn:storageos:Alert:33f5dedc-0186-128b-8d53-58fb1fcfd04a;True'], [u'2023-01-22T13:05:29;Quota;SoftQuotaLimitExceeded:', u'Namespace', u'es_fmg_avz2;WARNING;es_xxx_xxxx;urn:storageos:Alert:d9957764-0185-1be2-af88-c07662bb9bdb;True']]
```
What I'm doing wrong?

BR,

If you want to use ; as the separator for your data, you have to define this inside the section header.

Example

<<<lnx_thermal:sep(124)>>>
thermal_zone0|-|BAT0|35600

Separator |
You need to specify “sep(59)” if you want to use the semicolon.

or use sep(0) to not have any splitting at all.

Oooh My Goodness!!!

Thank you guys

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.