I am not a scripting or any other language guy, unfortunately, but yet I have been tasked with a challenge - Create a custom sensor that will display the age of the system (windows install) and/or the age of the system (via BIOS). I have found two PS commands that accomplish this task:
Windows Install: ([WMI]'').ConvertToDateTime((Get-WmiObject Win32_OperatingSystem).InstallDate) BIOS Date: $bios = gwmi Win32_BIOS;($bios.ConvertToDateTime($bios.releasedate).ToShortDateString())
So I created a PS1 file for each of these and deposited them into the Custom Sensors/EXEXML folder on the probe. Added the EXE/Script Advanced sensor and selected one of the scripts. But then I got back and error XML: The returned xml does not match the expected schema. (code: PE233) -- JSON: The returned json does not match the expected structure (Invalid JSON.). (code: PE231).
So there are two problems I need to solve.
- 1. How do I rewrite the PS files to output a properly formatted answer for the sensor to display?
- 2. How can I then set up an alert of the system so that any date that is past 3 years of age triggers an alert?
If this isn't possible, that's fine, but I am still expected to try first. Already dumped a couple of hours into this, I don't mind a few more :).
Add comment