|
|
| Author |
Message |
mrh Cacti User
Joined: 08 Mar 2005 Posts: 84
|
Posted: Tue May 23, 2006 3:59 am Post subject: 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
| Description: |
|
| Filesize: |
20.56 KB |
| Viewed: |
14919 Time(s) |

|
| Description: |
|
| Filesize: |
33.43 KB |
| Viewed: |
14919 Time(s) |

|
| Description: |
| BES graph templates+script |
|
 Download |
| Filename: |
bes.zip |
| Filesize: |
6.04 KB |
| Downloaded: |
1388 Time(s) |
|
|
| Back to top |
|
 |
qwertz Cacti User
Joined: 16 Feb 2006 Posts: 98
|
Posted: Tue May 23, 2006 1:01 pm Post subject: |
|
|
Thanks
Do you think I will be able to use it from a cacti over LINUX?
Qwertz
|
|
| Back to top |
|
 |
mrh Cacti User
Joined: 08 Mar 2005 Posts: 84
|
Posted: Tue May 23, 2006 1:20 pm Post subject: |
|
|
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
|
|
| Back to top |
|
 |
_JPL_ Cacti User
Joined: 29 Nov 2004 Posts: 58
|
Posted: Fri Jun 02, 2006 9:21 am Post subject: |
|
|
| You can do the same thing in linux using the nsclient in windows (or similar client) by polling the perfmon values with check_nt.
|
|
| Back to top |
|
 |
AndyStewart Cacti User
Joined: 29 Sep 2005 Posts: 102 Location: Edinburgh, Scotland
|
Posted: Fri Jun 02, 2006 9:44 am Post subject: |
|
|
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...
|
|
| Back to top |
|
 |
HoK
Joined: 12 Apr 2005 Posts: 3
|
Posted: Mon Jun 26, 2006 11:33 am Post subject: 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!
| Description: |
|
| Filesize: |
61.44 KB |
| Viewed: |
14524 Time(s) |

|
|
|
| Back to top |
|
 |
AndyStewart Cacti User
Joined: 29 Sep 2005 Posts: 102 Location: Edinburgh, Scotland
|
Posted: Tue Jun 27, 2006 3:05 am Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
AndyStewart Cacti User
Joined: 29 Sep 2005 Posts: 102 Location: Edinburgh, Scotland
|
Posted: Wed Jun 28, 2006 8:10 am Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
HoK
Joined: 12 Apr 2005 Posts: 3
|
Posted: Wed Jun 28, 2006 3:02 pm Post subject: |
|
|
| Good work! I changed the data input source to the /nologo and everything is working great now. Thanks for the fix!
|
|
| Back to top |
|
 |
jwashburn
Joined: 09 Jun 2006 Posts: 33
|
Posted: Wed Jul 12, 2006 5:14 pm Post subject: |
|
|
| I still have a strange problem on this one. If I run the script manually no problem, I get data. If I run it as a scheduled task I get a WMI connection failed message.
|
|
| Back to top |
|
 |
eddy
Joined: 03 Apr 2002 Posts: 31 Location: Mississauga, Ontario
|
Posted: Wed Jul 19, 2006 12:30 pm Post subject: 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.
|
|
| Back to top |
|
 |
mrh Cacti User
Joined: 08 Mar 2005 Posts: 84
|
Posted: Tue Aug 29, 2006 7:52 am Post subject: |
|
|
eddy, try to run wmiadap /f on your BES 2003 server (if it has that OS, if 2000, you need to run a different command to rebuild WMI I don't remember now...)
After that you should be able to see WMI perf counters for BES
|
|
| Back to top |
|
 |
eddy
Joined: 03 Apr 2002 Posts: 31 Location: Mississauga, Ontario
|
Posted: Tue Aug 29, 2006 3:12 pm Post subject: |
|
|
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",,4
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.
|
|
| Back to top |
|
 |
mrh Cacti User
Joined: 08 Mar 2005 Posts: 84
|
Posted: Tue Sep 19, 2006 9:04 am Post subject: |
|
|
Please everyone make sure the polling account for the schedule task has administrator privileges on the target machine (or at least the same as when you're succeed on the command-line).
Thanks
|
|
| Back to top |
|
 |
dennett
Joined: 21 Aug 2006 Posts: 3
|
Posted: Tue Oct 17, 2006 10:58 pm Post subject: |
|
|
Hey guys,
I have Cacti running on a Solaris box - is there a way to grab the Blackberry stats (on Win Svr) in this situation?
thanks...
|
|
| Back to top |
|
 |
|