Solved

Event Handler doesn't work

  • 23 January 2024
  • 1 reply
  • 65 views

Badge +6

Hello, I’m doing some tests and I try to configure an Event handler for a service named “check_pepe”. I followed these instructions:

the event_handler miscelanius:

$CENTREON_PLUGINS$/event_handler_test.sh $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPTS$ $SERVICEDISPLAYNAME$ $LONGSERVICEOUTPUT$ $HOSTALIAS$ $HOSTADDRESS$


my event_handler_test.sh in the folder /usr/lib/centreon/plugins/ with 777 permissions (I also tried to view if the problem was about the permissions)

#!/bin/bash
echo "HOLA" > test.txt
echo -e "SERVICESTATE: ${1}\nSERVICESTATETYPE: ${2}\nSERVICEATTEMPTS${3}\nSERVICEDISPLAYNAME: ${4}\nLONGSERVICEOUTPUT: ${5}\nHOSTALIAS: ${6}\nHOSTADDRESS:${7}" > event_handler.txt

 

Every time my service change from OK to other state it doesn’t activate the script.

Some logs:
 

[2024-01-23T16:08:49.888+00:00] [events] [info] [1885] SERVICE ALERT: windows_vm;check_pepe;CRITICAL;HARD;3;CRITICAL: Storage 'E:' Usage Total: 5.00 GB Used: 4.96 GB (99.13%) Free: 44.71 MB (0.87%) WARNING: Storage 'D:' Usage Total: 5.00 GB Used: 4.02 GB (80.51%) Free: 997.39 MB (19.49%)
[2024-01-23T16:08:49.923+00:00] [events] [info] [1885] SERVICE EVENT HANDLER: windows_vm;check_pepe;CRITICAL;HARD;3;event_handler__misc

 

the event_handler miscellaneous name event_handler__misc is correct.

I also tried to fins the files that the scripts creates and I cant find theme with the command `find / -name test.txt -type f`

icon

Best answer by ruben_mendez 25 January 2024, 11:04

View original

1 reply

Badge +6

Hi, I resolved it, The problem was the variable $CENTREONPLUGINS$ I changed it for “/usr/lib/centreon/plugins” and it started working
 

Reply