BES (BlackBerry Enterprise Server) template using WMI
Moderators: Developers, Moderators
BES (BlackBerry Enterprise Server) template using WMI
Morning cacti community!
I've wrote a VBS script to get BES statistics with WMI. Enjoy it
Cheers
I've wrote a VBS script to get BES statistics with WMI. Enjoy it
Cheers
- Attachments
-
- bes.zip
- BES graph templates+script
- (6.04 KiB) Downloaded 3509 times
-
- bes_messages.png (33.43 KiB) Viewed 47781 times
-
- bes_message_queue.png (20.56 KiB) Viewed 47781 times
mrh | cacti 0.8.6h | plugin architecture | thold | monitor | iis6
I'm not sure, but possibly if you find which command replaces the "cscript.exe" for Windows, you should!
Try running at your prompt the VBS with the command you use in linux and see if it gathers any value from your BES.
You also need to make sure you have WMI privileges on the BES - I don't know how to do that, but perhaps you can find something regarded in this forum...
Have luck
Try running at your prompt the VBS with the command you use in linux and see if it gathers any value from your BES.
You also need to make sure you have WMI privileges on the BES - I don't know how to do that, but perhaps you can find something regarded in this forum...
Have luck
mrh | cacti 0.8.6h | plugin architecture | thold | monitor | iis6
- AndyStewart
- Cacti User
- Posts: 102
- Joined: Thu Sep 29, 2005 5:21 am
- Location: Edinburgh, Scotland
Great! now if i can just get my blackberry administrator to get off his ass and install snmp on the boxes....
/goes off to find his big stick...
/goes off to find his big stick...
I don't care if the glass is half full or half empty, i want to know, who's been drinking my pint!!!
[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
BES VB Script Runs But Cannot Graph...nan
Just wondering if anyone else got this running? I'm running Cacti 0.8.6h on a Windows 2003 box. I can succesfully retrieve results from the commandline on the Cacti box for my BES server.
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
C:\Apache2\htdocs\cacti\scripts>cscript BES_Stats.vbs 10.100.10.22
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
MessagesExpired:0 MessagesFiltered:7 MessagesQueuedForDelivery:25 MessagesReceived:59999 MessagesSent:5088
However, my graphs just show 'nan' for the info and no graph lines. I'm not sure if it has something to do with the <nologo> parameter in the Data Input Method. Here is what I have... I have tried with the <nologo> and without.
cscript <nologo><path_cacti>/scripts/BES_Stats.vbs <hostname>
The path is correct and I have no other problems running other scripts or graphing in Cacti. I would love to get this working. Any assistance would be greatly appreciated. Thanks!
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
C:\Apache2\htdocs\cacti\scripts>cscript BES_Stats.vbs 10.100.10.22
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
MessagesExpired:0 MessagesFiltered:7 MessagesQueuedForDelivery:25 MessagesReceived:59999 MessagesSent:5088
However, my graphs just show 'nan' for the info and no graph lines. I'm not sure if it has something to do with the <nologo> parameter in the Data Input Method. Here is what I have... I have tried with the <nologo> and without.
cscript <nologo><path_cacti>/scripts/BES_Stats.vbs <hostname>
The path is correct and I have no other problems running other scripts or graphing in Cacti. I would love to get this working. Any assistance would be greatly appreciated. Thanks!
- Attachments
-
- BES Messages...nan
- BES_Messages.png (61.44 KiB) Viewed 47386 times
- AndyStewart
- Cacti User
- Posts: 102
- Joined: Thu Sep 29, 2005 5:21 am
- Location: Edinburgh, Scotland
Just spotted i'm having the same issue:
Script run from command line:
E:\Inetpub\wwwroot\cacti\scripts>cscript BES_stats.vbs 2kslehbes01
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
MessagesExpired:148 MessagesFiltered:18237 MessagesQueuedForDelivery:1101 Messag
esReceived:428251 MessagesSent:25939
But graphs all showing NaN for all values.
Script run from command line:
E:\Inetpub\wwwroot\cacti\scripts>cscript BES_stats.vbs 2kslehbes01
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
MessagesExpired:148 MessagesFiltered:18237 MessagesQueuedForDelivery:1101 Messag
esReceived:428251 MessagesSent:25939
But graphs all showing NaN for all values.
I don't care if the glass is half full or half empty, i want to know, who's been drinking my pint!!!
[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
- AndyStewart
- Cacti User
- Posts: 102
- Joined: Thu Sep 29, 2005 5:21 am
- Location: Edinburgh, Scotland
Solution:
Well, at least this resolved my issue:
- On Console under Collection Methods, go into Data Input Methods
- Select BES Stats
- Change input string from:
cscript <nologo><path_cacti>/scripts/BES_Stats.vbs <hostname>
to
cscript /nologo <path_cacti>/scripts/BES_Stats.vbs <hostname>
my graphs are now recording data correctly and showing correctly.
Well, at least this resolved my issue:
- On Console under Collection Methods, go into Data Input Methods
- Select BES Stats
- Change input string from:
cscript <nologo><path_cacti>/scripts/BES_Stats.vbs <hostname>
to
cscript /nologo <path_cacti>/scripts/BES_Stats.vbs <hostname>
my graphs are now recording data correctly and showing correctly.
I don't care if the glass is half full or half empty, i want to know, who's been drinking my pint!!!
[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
Post subject: BES (BlackBerry Enterprise Server) template us
This is great just what I was looking for!! One question though - what version of BES server are running, mine does not have the WMI class Win32_PerfRawData_BlackBerryEnterpriseServer_BlackBerryServer listed under cim2, thanks again for a great template/script.
mrh - thanks that worked and I can now run your script manually and I get the expected results. However when the scripts runs as part of cacti I see this in the logs.
CACTID: Poller[0] Host[157] DS[1175] WARNING: Result from SCRIPT not valid. Partial Result: ...
CACTID: Poller[0] Host[157] ERROR: Empty result [10.1.1.1]: 'cscript -nologo D:/Apache2/htdocs/cacti/scripts/BES_Stats.vbs 10.1.1.1'
I realize that there are permission issues so i modified your script so that is supplies a username and password to the server being queried. So my script looks like this.
Const WbemAuthenticationLevelPktPrivacy = 6
Set objArgs = wscript.Arguments
strComputer = objArgs.item(0)
strNamespace = "\root\cimv2"
strUser = "somedomain\someusername"
strPassword = "someuserspassword"
Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objwbemLocator.ConnectServer _
(strComputer, strNamespace, strUser, strPassword)
objWMIService.Security_.authenticationLevel = WbemAuthenticationLevelPktPrivacy
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_OperatingSystem")
For Each objItem in ColItems
Next
On Error Resume Next
Set objArgs = wscript.Arguments
strComputer = objArgs.item(0)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_BlackBerryEnterpriseServer_BlackBerryServer",,48)
For Each objItem in colItems
Wscript.Echo "MessagesExpired:" & objItem.MessagesExpired & " MessagesFiltered:" & objItem.MessagesFiltered & " MessagesQueuedForDelivery:" & objItem.MessagesQueuedForDelivery & " MessagesReceived:" & objItem.MessagesReceived & " MessagesSent:" & objItem.MessagesSent
Next
The odd thing is when I use wireshark to sniff the traffic, there is NO traffic generated by the running of the script the logs show the errors noted above but the script NEVER gets onto the wire.
CACTID: Poller[0] Host[157] DS[1175] WARNING: Result from SCRIPT not valid. Partial Result: ...
CACTID: Poller[0] Host[157] ERROR: Empty result [10.1.1.1]: 'cscript -nologo D:/Apache2/htdocs/cacti/scripts/BES_Stats.vbs 10.1.1.1'
I realize that there are permission issues so i modified your script so that is supplies a username and password to the server being queried. So my script looks like this.
Const WbemAuthenticationLevelPktPrivacy = 6
Set objArgs = wscript.Arguments
strComputer = objArgs.item(0)
strNamespace = "\root\cimv2"
strUser = "somedomain\someusername"
strPassword = "someuserspassword"
Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objwbemLocator.ConnectServer _
(strComputer, strNamespace, strUser, strPassword)
objWMIService.Security_.authenticationLevel = WbemAuthenticationLevelPktPrivacy
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_OperatingSystem")
For Each objItem in ColItems
Next
On Error Resume Next
Set objArgs = wscript.Arguments
strComputer = objArgs.item(0)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_BlackBerryEnterpriseServer_BlackBerryServer",,48)
For Each objItem in colItems
Wscript.Echo "MessagesExpired:" & objItem.MessagesExpired & " MessagesFiltered:" & objItem.MessagesFiltered & " MessagesQueuedForDelivery:" & objItem.MessagesQueuedForDelivery & " MessagesReceived:" & objItem.MessagesReceived & " MessagesSent:" & objItem.MessagesSent
Next
The odd thing is when I use wireshark to sniff the traffic, there is NO traffic generated by the running of the script the logs show the errors noted above but the script NEVER gets onto the wire.
Who is online
Users browsing this forum: No registered users and 0 guests