I wrote an action script. It's very simple for the purposes of troubleshooting this issue, just a one liner. It's in powershell, and it just writes a single line to a log file, on the monitoring server. It doesn't contact the remote server or do anything, just yet.

I can get it to fire using the test functionality, but only when I run the test against certain monitored servers. On others, my log file is not created.

What would or could prevent this from working ?

asked 07 Nov '17, 23:11

ala's gravatar image

ala
1112
accept rate: 0%


Hi ala,

Can you provide the script that you are running in the Execute Script action? Also, Any details needed to test the script like what type of monitor are you attaching it to and when would the action be fired.

Thanks
Quinn

Please make sure to mark your questions accepted when you have your answer by clicking the gray check mark to the left of the answer.

link

answered 08 Nov '17, 11:45

Quinn's gravatar image

Quinn ♦♦
14.5k3925
accept rate: 35%

hi, i put my own "answer" below as I ran out of characters in this comment, thanks

(08 Nov '17, 13:49) ala

Hi

This is not even attached to a monitor yet, and I was testing by running the "test" gui, although I also tried it out against a disk space monitor. Eventually I'd like to trigger it from another script based monitor that alerts on a performance counter value, once I can get past this functionality issue.

The script is simply (for now, I have a much more lengthy script I'd eventually like to use, which I have proven works/doesn't work in the same fashion)

"test content" |out-file c:\temp\log.log -Append

I've done alot of testing and this is my first effort at seeking support. My issue is that this script only works when I run the test 'against' certain servers.

  • Why would this be the case?
  • Is it perhaps that PAmon tries to "do something" to these servers I am testing against prior to running the script?
  • Is there a way to turn on more verbose action script logging?
  • Is this something we can troubleshoot more effectively over a more formal support session?

thanks

link

answered 08 Nov '17, 13:49

ala's gravatar image

ala
1112
accept rate: 0%

edited 08 Nov '17, 13:50

ala,

I just tested your code by creating a new execute script action. I added the action to a disk space monitor of a server that is monitored by a satellite and then added the action to a webpage monitor that was monitored by the central service. Both worked as they should. The script (below) was to write output to a local file on the C: drive of the central service (c:templog.txt).

$date = [System.DateTime]::Now

"test content " + $date |out-file c:\temp\log.txt -Append

If you can supply more details about your monitoring of different servers and what the output was you can send that information to support@poweradmin.com

Thanks
Quinn

Please make sure to mark your questions accepted when you have your answer by clicking the gray check mark to the left of the answer.

link

answered 08 Nov '17, 15:17

Quinn's gravatar image

Quinn ♦♦
14.5k3925
accept rate: 35%

edited 08 Nov '17, 15:18

I am having a similar issue, however; I have found it's due to calling additional installed modules on the server. I am unable to execute commands that come from PS Modules. Specifically, the AWSPowerShell module and a custom written module of our own design. The script will run flawlessly if executed outside of Server Monitor, but when run in the context of an execute script action, there is no indication of an issue, the script simply stops.

To try and narrow things down, I have written logging steps, and everything is well and good until I call a function from another module. If I use "Import-Module", the action will not fire and there is still no indication of what the issue may be.

link

answered 14 Nov '17, 16:10

TheSemicolon's gravatar image

TheSemicolon
33810
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×16
×10
×4

Asked: 07 Nov '17, 23:11

Seen: 174,420 times

Last updated: 14 Nov '17, 16:10