The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.3.15 (Linux)
File Line Function
/showthread.php 895 errorHandler->error


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alerts Pandora FMS (Windows) integration with Slack
#1
Hi Guys,

I have a pandora fms Server 7.0 environment installed on Windows Server, and  i want integrate the alerts with slack, the following link explains the procedure.


https://pandorafms.com/blog/integrating-...ndora-fms/


However, i have a problem with the script to configurate in the alerts command sections, in the example is:

root/slack.sh "_field1_"


But my Pandora server is installed on windows, i created a new versión of the script for batch: slack.bat 



Code:
curl -k -X POST -H "Content-type: application/json" --data "{\"username\": \"pandorafmsbot\", \"text\": \"%~1\", \"icon_url\": \"http://cdn9.staztic.com/app/a/3528/3528476/pandora-fms-1-l-78x78.png\"}" https://hooks.slack.com/services/TF1MWK4H2/ZZZZZZZZZ/b0VKs3GM7lNNNNNNNNNNNNNN
echo %date% %time% >> C:\Windows\Temp\slacklog.txt



The script works from tests by command line, but it does not work in Pandora FMS ( new alert from command sections) with the following configurations :


slack.bat "_field1_"

or

cmd.exe slack.bat "_field1_"

or 

cmd.exe /c slack.bat "_field1_"

or

C:\Program Files\PandoraFMS\Pandora_Server\bin\slack.bat



And none of the option works, do you have any idea what may be missing?. I am monitoring the execution of the .bat script from the server and I know that it is not invoked from Pandora.

Note: Put the script slack.bat in the folder "C:\Program Files\PandoraFMS\Pandora_Server\bin", this path is part of the windows environment variable $PATH


Regards,


Attached Files


.png   Capturapandoraslack.PNG (Size: 49.06 KB / Downloads: 8)
 Reply


Users browsing this thread: 1 Guest(s)


(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | pandorafms.com | pandorafms.org

Theme © MyBB Themes