Windows Activation Monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Windows Activation Monitoring

Post 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!!
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Windows Activation Monitoring

Post 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
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Windows Activation Monitoring

Post 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
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Windows Activation Monitoring

Post 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?
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Windows Activation Monitoring

Post 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
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Windows Activation Monitoring

Post 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.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Windows Activation Monitoring

Post 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"
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Windows Activation Monitoring

Post 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?
You do not have the required permissions to view the files attached to this post.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Windows Activation Monitoring

Post 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
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Windows Activation Monitoring

Post 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.
You do not have the required permissions to view the files attached to this post.
Locked