Hello Community !
Here is the configuration I'm tryuing to apply, in order to acknowledge an alert.
In this example, the topic is to create the acknowledge when the traffic on interface Tu30 is greater than 0.1%.
1-
The CLAPI command to execute is the following.
centreon -u admin -p xxx -o RTACKNOWLEDGEMENT -a add -v "SVC;RouterName,Traffic-Tu30;ACK test;2;0;1"
When I'm trying directly this command on the central, it works fine.
2-
So, I've created the following script, called handle-acknowledge-test, in /usr/lib/centreon/plugins/eventhandler/ directory
#!/bin/bash
#script to acknowledge WARNING status on RouterName host, Traffic-Tu30 service
case "$1" in
CRITICAL)
;;
WARNING)
centreon -u admin -p xxx -o RTACKNOWLEDGEMENT -a add -v "SVC;RouterName,Traffic-Tu30;ACK test;2;0;1";;
UNKNOWN)
;;
OK)
;;
esac
exit 0
Rights are described here :
# ls -l | grep handle-acknowledge-test
-rwxr-xr-x 1 centreon centreon 304 Jul 5 07:48 handle-acknowledge-test
3-
The command handle-acknowledge-test has been created (Configuration > Commands > Checks)
Command Type = "Check"
$CENTREONPLUGINS$/eventhandler/handle-acknowledge-test.sh $SERVICESTATETYPE$
4-
Event handler has been configured :
Configuration > Pollers > Engine configuration, tab Check Options, Event Handler Option="Yes"
Configuration > Services > Services by host, tab Data Processing, Event Handler Enabled="Yes", Event Handler="handle-acknowledge-test"
5-
But finally, the acknowledge is not activated when the service is on warning, in spite of the following results on logs :
# tail -f /var/log/centreon-engine/centengine.log
1657003966] 521] SERVICE ALERT: RouterName;Traffic-Tu30;WARNING;SOFT;1;WARNING: Interface 'Tu30.39%)
01657003966] S521] SERVICE EVENT HANDLER: RouterName;Traffic-Tu30;WARNING;SOFT;1;handle-acknowled
If someone can help me at this point, it should be nice. And if finally it works, I'll create a topic with screenshot on The Watch to share this experience.