
Fabien OPs (Customer) asked a question.
Hello guys,
I want to create some Powershell Active Monitors for checking my Disks, CPU and RAM on my servers through SNMP. I know that Performance Monitors are making this job, but i want to execute an other Powershell script when the monitor goes down, and, as i know, Performance monitors only send mail or sms. (Maybe i'm wrong)
So, i made a script. it started with :
- # Create SNMP Object
- $oSnmp = New-Object -ComObject CoreAsp.SnmpRqst
- $nDeviceID = $Context.GetProperty("DeviceID")
- $oSnmp.Initialize($nDeviceID)
It works well but, when i enable it on two differents servers. I have this error :
- COM object that has been separated from its underlying RCW cannot be used. The COM object was released while it was still in use on another thread.
And the monitor goes up and down many times randomly. It's like WUG can't manage two ComObject in the same time. Or i don't use it as i should.
I also tried to create a PowerShell Active monitor without SNMP API, but, wug doesn't recognized "snmpwalk" & "snmpget" commands when i enable the monitor. However, they are installed on the wug server, and i can use it on powershell ?
Do you have any idea please?
Thanks
I finally figured it out.
It was very simple indeed. I copied my commands (snmpwalk.exe and snmpget.exe) into the execution monitor folder : "C:\Program Files (x86)\Ipswitch\WhatsUp". Then, in my PowerShell Active monitor script, i executed them with ".\snmpget.exe". It works properly! :)