Query PowerShell via Agent
-
Hi,
I wonder if it would be possible to execute a PowerShell command via the agent and return the output result to NetXMS for monitoring? For example, I'd like to send the following PowerShell query to my Exchange 2010 server, in order to find out how many e-mails currently are waiting delivery in mail queue:
Get-Queue -Sort-Order:-MessageCount -Result:1 | fl -Property MessageCountMaybe there is a better solution for what I'm attempting?
Thanks!
Anders
-
Hi!
You can define external parameter in agent. Add the following line to your nxagentd.conf:
ExternalParameter = Exchange.MessageCount:powershell -Command "& {Get-Queue -Sort-Order:-MessageCount -Result:1 | fl -Property MessageCount}"
Part before : is a name for new parameter, you can set it whatever you want.
Restart agent, do configuration poll on a node, and you should see new parameter in parameters oist and be able to collect it as any other agent's parameter.
Best regards,
Victor -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login