Windows Disk Cleanup via Powershell

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jpelley
Posts: 44
Joined: Wed Jul 22, 2015 12:14 pm

Windows Disk Cleanup via Powershell

Post by jpelley »

So my Windows guys created a Powershell script to do some minor C:/ cleanup and want me to add the script to NagiosXI when a Warning is generated. I understand how event handling works in Nagios but my scripting skills are limited. Where do I start, what is best practice? I've scoured old posts and see where some use NCSA or NRPE or some other methodologies I'm not familiar with. We use agent-less monitoring via WMI and I'd love to continue with an agent-less process (or at least pass a Host arg to a Windows gateway server to execute).
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Windows Disk Cleanup via Powershell

Post by hsmith »

I really can't say for sure, but running remote code on a Windows machine without an agent is going to be difficult.

I did find this article, https://4sysops.com/archives/three-ways ... e-commands but it's kind of out of the scope of what we're going to be able to help you with.
jpelley wrote:Where do I start, what is best practice?


Event handlers are exactly what you are looking for. To be completely honest, NSClient would be your best friend in this scenario, but doing it via WMI is going to be tough.
Former Nagios Employee.
me.
Locked