Page 1 of 2

Windows Activation Monitoring

Posted: Thu Jun 03, 2021 2:05 am
by kalyanpabolu
Hi Team,

Can we monitor Windows Activation using Nagios XI?
We recently faced issue where Windows was not activated on a machine and that created a big problem.

Is there a way in Nagios where we can get alert for Windows systems if in case Windows is not activated for them.

Please suggest.

Thanks in advance!!

Re: Windows Activation Monitoring

Posted: Thu Jun 03, 2021 2:35 pm
by vtrac
Hi,
How are you doing?
I would suggest that you write your own plugin, then calls it using "check_ncpa.py".

Here's an example. Please NOTE I'm not a PowerShell programmer, so you will have to modify or add more to the example below:

Code: Select all

(Get-CimInstance SoftwareLicensingProduct -Filter "Name like 'Windows%'" | where { $_.PartialProductKey } | select Description, LicenseStatus)
Outputs:

Code: Select all

Description                                 LicenseStatus
-----------                                 -------------
Windows(R) Operating System, OEM_DM channel             1
If your output of "LicenseStatus" is "1" as above, then your system is activated.


Best Regards,
Vinh

Re: Windows Activation Monitoring

Posted: Thu Jun 03, 2021 2:36 pm
by vtrac
Also, please NOTE that the provided PS example command seems to take a few seconds to run, so you might have to set bigger for "timeout".

Vinh

Re: Windows Activation Monitoring

Posted: Tue Jun 22, 2021 11:43 am
by kalyanpabolu
Hello,

thanks for your inputs.

We are not willing to place any script on windows machine.
Is that possible to check it using a shell script or say plugin from Nagios server?

Re: Windows Activation Monitoring

Posted: Tue Jun 22, 2021 1:24 pm
by vtrac
Hi @kalyanpabolu,
Hope you are having a good day!!

I'm very sorry, but Nagios do not have any module that will check for Windows license activation.

I was suggested as a way to get that in my previous replied but you must come up with your own PowerShell script.


Best Regards,
Vinh

Re: Windows Activation Monitoring

Posted: Mon Aug 16, 2021 10:40 am
by kalyanpabolu
Hello,

We have run the command "slmgr.vbs -xpr" in one of the servers and we got the pop-up(PFA) in which its is showing volume activation expiration date. Please let us know how we can monitor this pop-up result through Nagios.

Re: Windows Activation Monitoring

Posted: Mon Aug 16, 2021 4:18 pm
by ssax
This should be the same process:

https://support.nagios.com/forum/viewto ... 671#p39671

What does this output?

Code: Select all

cscript //NoLogo c:\windows\system32\slmgr.vbs -xpr | find "expire"

Re: Windows Activation Monitoring

Posted: Wed Aug 18, 2021 9:55 am
by kalyanpabolu
Hello,

Thank you for your reply!!

Please find attached output of the command you gave. Actually we don't have NSClient++ installed on our machines. Can we monitor this with NCPA?

Re: Windows Activation Monitoring

Posted: Thu Aug 19, 2021 9:50 am
by vtrac
Hi,
Yes, you can us NCPA.

Create a bat file let call it "check_license.bat" and put that under NCPA's plugins folder:
"C:\Program Files (x86)\Nagios\NCPA\plugins\"

Now, open a command prompt from your Nagios XI and run:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'yourNCPAtoken' -M 'plugins/check_license.bat'

Regards,
Vinh

Re: Windows Activation Monitoring

Posted: Wed Aug 25, 2021 5:52 am
by kalyanpabolu
Hello,

Thank you!!! it is working. We have tested it one of the our machine and it is working fine(PFA).

Can you please help me to monitor this activation date, show it Critical and Warning in Nagios and send an alert when license is about to expire in 30 and 60 days respectively ?

Thanks in advance.