I am trying to get a .bat file to run as a notification. But I am unsuccessful. I am using WinRS (http://msdn.microsoft.com/en-us/library/windows/desktop/aa384372(v=vs.85).aspx) to run the command on a remote machine. The command I am running is a single line and I am not passing any parameters to the script. The script is below.

c:\windows\system32\winrs -r:10.10.10.10 -d:"c:\windows\system32\inetsrv" -noprofile appcmd recycle apppool "DefaultAppPool"

I know that the script tries to execute, but the logs show the following error: Error sending "EXE": Error6

I can successfully run the script from the command line, but it is not successful when I try to run it through prtg.

I've read through this article https://kb.paessler.com/knowledgebase/en/topic/31103-prtg-notification-not-running-exe and I've read through this article https://kb.paessler.com/knowledgebase/en/topic/2543-how-can-i-execute-a-batch-file-as-notification

Any other suggestions?


Article Comments

Hi,

This is what I read at the msdn link you supplied: "the WinRM config command creates a firewall exception only for the current user profile. If the firewall profile is changed for any reason, winrm quickconfig should be run to enable the firewall exception for the new profile; otherwise, the exception might not be enabled."

As PRTG runs under the local system credentials, could it be the firewall not having an exception for that user profile?

Regards,


Mar, 2012 - Permalink

Thanks for the response. Neither the server running PRTG nor the target server are running a firewall. I did try changing who the service is running as, but that didn't change anything either.

Is the "Error6" that shows in the logs when PRTG tries to run the script a generic error, or is there an actual description that would give me more of an idea where it's failing?


Mar, 2012 - Permalink