What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Error sending "EXE": Error6 when trying to run a .bat file which calls WinRS.

Votes:

0

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?

-bat error6 notification prtg

Created on Mar 24, 2012 1:28:43 AM



2 Replies

Votes:

0

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,

Created on Mar 27, 2012 7:11:22 PM



Votes:

0

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?

Created on Mar 27, 2012 10:09:42 PM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.