UPDATED: See solution below my signature.
Hello, I've fixed the problem. Although it is not possible to use a proxy through PRTG Monitor 7, I've made an Execute EXE program action that solves my problem. I will provide the details and script later, but here is how it works :
I've installed curl in the Notifications/EXE folder, then I've created a BAT file. The EXE sensor passes several variables as an argument to the BAT file, the BAT files processes those and concatenates them into a string (an URL) which is then passed to curl.exe with additional command line parameters to provide curl with a proxy address, username and password of an authorized user to use the proxy (in my case a service account) and finally the HTTP action to perform.
Because this URL is in fact a prowl/growl API command, the URL needs to be passed properly, hence character substitution must be done for & (ampersand) symbols, otherwise the cmd.exe interpreter sees this as an action to run after the first command (command concatenation i.e. run program1.exe & program2.exe & program3.exe)
Passing these variables to the BAT file has one issue though: some of the values passed as parameters to the BAT file by paessler contain spaces, therefore the BAT reads each space as a delimiter to fill the next variable, leading to shifting in the originally desired values. I've already though of a fix for this, I will provide more details here and in my blog later.
Thanks and Best Regards;
Max
Update 22.03.2010 >>
I modified my action to call a VBS file instead of a BAT file, allowing me smoother work with string concatenation. Please see the VBS script below (edit where needed) :
dim x,Params,increment,ArgObj,cmdline
Set ArgObj=Wscript.Arguments
Set WshShell=Wscript.CreateObject("Wscript.Shell")
Params=""
For increment=0 to ArgObj.count - 1
Params = Params & ArgObj(increment) & "%20"
Next
cmdline="-U domain\user:password -k -x myproxy.company.org:80 "
&"https://prowl.weks.net/publicapi/add?apikey=MY0000API0000KEY&application=My%20Monitoring&event=Alarm&description="
& params
x = WshShell.Run("""C:\program files\PRTG Network Monitor\Notifications\EXE
\curl.exe""" & cmdline)
Et voila! :)
I will post the problematic on my blog : http://www.kamshin.com
Add comment