Monitoring/Centreon - SNMP Plugin command does not work with simple quote

0

I have a problem with one of my sonde (plugin) in Centreon.

On my poller server, I launch this command:

/usr/bin/perl /usr/lib/nagios/plugins/centreon-plugins-master/centreon_plugins.pl --plugin=os::linux::snmp::plugin --mode=storage --hostname=XXX.XXX.XXX.XXX --warning-usage=80 --critical-usage=90 --snmp-version=2c --snmp-community=supervision --space-reservation=5 --verbose  --explode-perfdata-max --name --regexp --storage='^(?!(/mnt.*)$)'

It works perfectly.

When I configure my sonde in Centreon Admin Console, and execute it, I have an error: (Execute command failed)

/usr/bin/perl /usr/lib/nagios/plugins/centreon-plugins-master/centreon_plugins.pl
    --plugin=os::linux::snmp::plugin
    --mode=storage
    --hostname=XXX.XXX.XXX.XXX
    --warning-usage=80
    --critical-usage=90
    --snmp-version=2c
    --snmp-community=supervision
    --space-reservation=5
    --verbose 
    --explode-perfdata-max
    --name
    --regexp
    --storage='^(?!(/mnt.*)

It doesn't work cause it delete the last simple quote of my regex. I tried to search how to solve it, but I actually found nothing..

Is someone could help me ? :)

mangasource

Posted 2019-08-22T06:45:49.043

Reputation: 1

Answers

0

I found the answer on the official Centreon Slack :)

Centreon Engine interpret $, so one of the solution is to double it like this :

--name --regexp --storage='^(?!(/mnt.*)$$)'

The proper solution is to use Macros. In the commands template I use, I add something like this : $_SERVICEEXCLUDEFS$. It will appears when I'll create a service like this. Then I can use this for this particular host (and no double $)

mangasource

Posted 2019-08-22T06:45:49.043

Reputation: 1