NSClient++ Help (#1) - check_nt (#245) - Message List
I am not a programmer, but do have a wish I think NSClient will be able to handle. I want to display text available from WMI.
http://msdn.microsoft.com/en-us/library/aa394588(VS.85).aspx
The third example shows how to use a VBS script to query the WMI interface to display the version of Microsoft Office Installed. (but it doesn't work for me checking the GUID of the installed Office)
How can I translate this into something check_nt would be able to use? I"m confused about the formatting of the query. The Case logic I can do.
--cut--(lousy formatting, sorry)
strComputer = "."
Set objWMIService = GetObject?("winmgmts:
" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery? _
("Select * From Win32_Product Where Name Like 'Microsoft Office%'")
If colItems.Count = 0 Then
Wscript.Echo "Microsoft Office is not installed on this computer."
Else
For Each objItem in colItems
Select Case objItem.Version
Case "12.0.6213.1000" OfficeVer?="Office 2007 SP1"
Case "12.0.4518.1014" OfficeVer?= "Office 2007 Original"
Case "11.0.7969" OfficeVer?= "Office Professional 2003"
Case "11.0.6502" OfficeVer?= "Office Professional 2003"
Case "11.0.6361.0" OfficeVer?= "Office Professional 2003"
Case "11.0.6359.0" OfficeVer?= "Office Professional 2003 SP1"
Case "11.0.5614.0" OfficeVer?= "Office Professional 2003"
Case "11.0.5207" OfficeVer?= "Office Professional 2003"
Case "11.0" OfficeVer?= "Office Professional 2003"
Case "10.0.6626.0" OfficeVer?= "Office XP Professional"
Case "10.0.4330" OfficeVer?= "Office XP Professional"
Case "10.0.3520.0" OfficeVer?= "Office XP Professional"
Case "10.0.2627.04" OfficeVer?= "Office XP Professional"
Case "10.0.2701.01" OfficeVer?= "Office XP Professional"
Case "10.0.2627.7" OfficeVer?= "Office XP Professional"
Case "10.0.2627.6" OfficeVer?= "Office XP Professional"
Case "10.0.2627.4" OfficeVer?= "Office XP Professional"
Case "10.0.2627.3" OfficeVer?= "Office XP Professional"
Case "10.0.2627.20" OfficeVer?= "Office XP Professional"
Case "10.0.2627.15" OfficeVer?= "Office XP Professional"
Case "10.0.2627.12" OfficeVer?= "Office XP Professional"
Case "10.0.2627.11" OfficeVer?= "Office XP Professional"
Case "10.0.2627.01" OfficeVer?= "Office XP Professional"
Case "10.0.2607.0" OfficeVer?= "Office XP Professional"
Case "9.00.9327" OfficeVer?= "Office 2000 SR-1 Professional"
Case "9.00.9821" OfficeVer?= "Office 2000 SR-1 Professional"
Case "9.00.3108" OfficeVer?= "Office 2000 Professional"
Case "9.00.9327" OfficeVer?= "Office 2000 Professional"
Case "9.00.2924" OfficeVer?= "Office 2000 Professional"
Case "9.00.2920" OfficeVer?= "Office 2000 Professional"
Case "9.00.2816" OfficeVer?= "Office 2000 Professional"
Case "9.00.2720" OfficeVer?= "Office 2000 Professional"
Case "8.0" OfficeVer?= "Office 97 Professional"
End Select
Next Wscript.Echo OfficeVer? End If --cut--
Thank you, TalkingToes?
PS I do not believe this is all the version numbers.
-
Message #723
not sure I know what you are trying to do but: 1, you need to use NRPE to use that from NSCLient++ (ie check_nrpe, as well as load the NRPELIstener.dll).
Then I would guess (depending on your choice of use) that you want to use the CHeckWMI command.
A good way to "Play" with the query is to use:
nsclient++ -noboot CheckWMI Select * From Win32_Product Where Name Like 'Microsoft Office%'
(on this machine the query seems to take forever to run, but I have noticed that with WMI some times).
Then you need to figure out what you need to do to which columns, there is another post somewhere where I explain this in "detail"...
MickeM
mickem09/14/08 23:42:40 (5 years ago)








