Pandora FMS Community

Scripts associated with SNMP alerts no longer run when SNMP traps are received

Christophe · 5 ene 2023, 9:49 · 7 mensajes · 136 visitas

Alertes SNMPScriptsSNMP
  1. Inicio del debate

    When we send an SNMP trap on the server, it is displayed in the SNMP console and the associated SNMP alert is triggered but the Python script does not run, does not modify the agents and does not write the messages in the log file. However, when we execute the script on the command line, it works, the agents in Pandora are updated and the messages in the log appear. In the file "pandora_server.log" we have the following message: "2023-01-04 12:00:22 Core: ip-10-61-4-225.eu-west-3.compute.internal [V3] Action 'launch SNMP script EMB' alert '' agent '' exceeded the global alert timeout 15 seconds" . However, the modules we send do not contain empty values. We have already tried several times to restart the server and the Pandora process in vain. Do you know where this problem can come from?

  2. Hi Christophe,

    Have you checked how long it takes to run the Python script ?

    If it takes more than 15 seconds, it is possible that the server will discard it because of the timeout, so we recommend that you check the timeout in the Pandora FMS server conf.

    /etc/pandora/pandora_server.conf

    # Maximum executing time of an alert (in seconds)

    global_alert_timeout 15

    Best regards,

    Vic.

  3. Hello Vic,

    Thank you for your quick answer.

    When we run the script by hand in the server console, it takes less than a second to respond. We have been using this same script for several months and it has always worked fine until now. We have the same problem with all the scripts that worked before (without having touched the "global_alert_timeout" setting).

    Best regards.

  4. Hi,

    Can you make sure that the Pandora FMS server has permissions to execute this script?

    A recommendation is to move the script to the following directory "/usr/share/pandora_server/util/plugin/" and give it the following permissions:

    -rwxr-xr-x pandora root

    In case it doesn't execute it, increase the server verbosity to 10 and restart the server process and try to force the module a couple of times, so the server will write in the server log and we could see the cause.

    Best regards,

    Víc.

  5. Hello!

    The permissions on the python file to be executed are the same as yours. We tried to apply your advice but it still didn't work. Increasing the global_alert_timeout didn't help either. We then increased the verbosity as you advised. In the file '/var/log/pandora/pandora_server.log' we have the result attached.

    I would like to point out that when we run the script by hand in the console with exactly the same parameters as those written in the screenshot (./kubapay_snmp_embv1.py -v ""'13311354 , 9 , 69 , 3 , 10'" -o .1.3.6.1.4.1.57001.1.1.2.2.14) the operation succeeds and the agent is updated.

    Do you have the correspondence of the error we get (Command for action 'launch SNMP script EMB' alert '' agent '' returned with errorlevel 1)?

    Thanks in advance !

    Best regards

    2023_01_17_16_19_33_root_ip_10_61_5_11_pandora_scripts.png24 KB · PNG
    2023_01_17_16_19_33_root_ip_10_61_5_11_pandora_scripts.png
  6. Hi Christophe,

    Are all the commands in the script correct (as I see there are empty fields)?

    If any of them is not mail it is possible that the server cannot execute it correctly.

    Have you tried to put a redirect to a file at the end of the script to see if you get an error in the execution by the server?

    Best regards,

    Vic.

  7. Hi Vic,

    We have checked the commands. Here is a screenshot of one of them attached.

    The paths are correct and all outputs are redirected to a file but when we send an SNMP trap nothing is written to the file. even if we replace all the content of the script with a simple write to the file, nothing happens. However, in the page "SNMP alerts" of Pandora, the line corresponding to the SNMP alert associated with the trap received is marked as having been triggered.

    The server on which we have this error is a copy of another server on which we do not have this problem.

    Thanks in advance for your help,

    Best regards,

    2023-01-19-15_32_37-Pandora-FMS-Systeme-de-surveillance-flexible.png2.9 KB · PNG
    2023-01-19-15_32_37-Pandora-FMS-Systeme-de-surveillance-flexible.png

Entra en tu cuenta para publicar.