Page 1 of 1
Information about license status ( Win Srv 2008 )
Posted: Tue Nov 13, 2012 10:10 am
by Bogdan_B
Hi,
Can you tell me if it is possible to pull somehow in Nagios the information about time remaining ? ( like as below image )
001.jpg
Cheers,
bb
Re: Information about license status ( Win Srv 2008 )
Posted: Tue Nov 13, 2012 11:45 am
by scottwilkerson
You can get that line from running the following
Code: Select all
cscript //NoLogo c:\windows\system32\slmgr.vbs -dli|find "Time Remaining"
You can create a command with that line in NSClient++ to return the data to Nagios.
This isn't going to do any checking on if it is expired, you would have to write a file script to parse that data if you wanted to do that.
Re: Information about license status ( Win Srv 2008 )
Posted: Wed Nov 28, 2012 8:36 am
by Bogdan_B
So,
I created the command in NSClient++ file. There are two more commands functioning correctly.
nsclient.jpg
The script should return "Licensed" but it returns "Error: product key not found."
script_win.jpg
returned.jpg
Re: Information about license status ( Win Srv 2008 )
Posted: Wed Nov 28, 2012 8:42 am
by Bogdan_B
All settings below :
command.jpg
serv_manag.jpg
Re: Information about license status ( Win Srv 2008 )
Posted: Wed Nov 28, 2012 10:20 am
by scottwilkerson
Can you post the output of running this from the windows command line
Code: Select all
cscript //NoLogo c:\windows\system32\slmgr.vbs -dli
and
Code: Select all
cscript //NoLogo c:\windows\system32\slmgr.vbs -dli|find "Time Remaining"
Re: Information about license status ( Win Srv 2008 )
Posted: Thu Nov 29, 2012 9:28 am
by Bogdan_B
command_promt.jpg
No output for last command.
Code: Select all
cscript //NoLogo c:\windows\system32\slmgr.vbs -dli|find "Time Remaining"
Re: Information about license status ( Win Srv 2008 )
Posted: Thu Nov 29, 2012 9:50 am
by Bogdan_B
I tried below command :
Code: Select all
cscript //NoLogo c:\windows\system32\slmgr.vbs -dli|find "License Status"
which returns
bbb.jpg
Nagios output is "Unrecognized option: -dli ".
Re: Information about license status ( Win Srv 2008 )
Posted: Thu Nov 29, 2012 12:14 pm
by scottwilkerson
Ok, we did some work on this for you and here is what we came up with:
Create a file license.bat in C:\Program Files\NSClient++\scripts with the following contents
Code: Select all
@echo off
cscript //NoLogo c:\windows\system32\slmgr.vbs -dli | find "Time Remaining"
Change your NSC.ini to be
restart NSClient++ service
Re: Information about license status ( Win Srv 2008 )
Posted: Wed Dec 05, 2012 3:58 am
by Bogdan_B
It is OK now.
Thank you !
Re: Information about license status ( Win Srv 2008 )
Posted: Wed Dec 05, 2012 10:26 am
by scottwilkerson
Awesome.
Glad you got it working.