BES (BlackBerry Enterprise Server) template using WMI

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

User avatar
mrh
Cacti User
Posts: 84
Joined: Tue Mar 08, 2005 9:50 am

BES (BlackBerry Enterprise Server) template using WMI

Post by mrh »

Morning cacti community!

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
bes_messages.png (33.43 KiB) Viewed 47787 times
bes_message_queue.png
bes_message_queue.png (20.56 KiB) Viewed 47787 times
mrh | cacti 0.8.6h | plugin architecture | thold | monitor | iis6
qwertz
Cacti User
Posts: 98
Joined: Thu Feb 16, 2006 9:20 am

Post by qwertz »

Thanks



Do you think I will be able to use it from a cacti over LINUX?

Qwertz
User avatar
mrh
Cacti User
Posts: 84
Joined: Tue Mar 08, 2005 9:50 am

Post by mrh »

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 8)
mrh | cacti 0.8.6h | plugin architecture | thold | monitor | iis6
_JPL_
Cacti User
Posts: 67
Joined: Mon Nov 29, 2004 11:34 am

Post by _JPL_ »

You can do the same thing in linux using the nsclient in windows (or similar client) by polling the perfmon values with check_nt.
User avatar
AndyStewart
Cacti User
Posts: 102
Joined: Thu Sep 29, 2005 5:21 am
Location: Edinburgh, Scotland

Post by AndyStewart »

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...
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]
HoK
Posts: 3
Joined: Tue Apr 12, 2005 11:28 am

BES VB Script Runs But Cannot Graph...nan

Post by HoK »

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!
Attachments
BES Messages...nan
BES Messages...nan
BES_Messages.png (61.44 KiB) Viewed 47392 times
User avatar
AndyStewart
Cacti User
Posts: 102
Joined: Thu Sep 29, 2005 5:21 am
Location: Edinburgh, Scotland

Post by AndyStewart »

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.
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]
User avatar
AndyStewart
Cacti User
Posts: 102
Joined: Thu Sep 29, 2005 5:21 am
Location: Edinburgh, Scotland

Post by AndyStewart »

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.
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]
HoK
Posts: 3
Joined: Tue Apr 12, 2005 11:28 am

Post by HoK »

Good work! I changed the data input source to the /nologo and everything is working great now. Thanks for the fix!
jwashburn
Posts: 33
Joined: Fri Jun 09, 2006 12:56 pm

Post by jwashburn »

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.
User avatar
eddy
Posts: 32
Joined: Wed Apr 03, 2002 8:48 am
Location: Mississauga, Ontario

Post subject: BES (BlackBerry Enterprise Server) template us

Post by eddy »

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.
User avatar
mrh
Cacti User
Posts: 84
Joined: Tue Mar 08, 2005 9:50 am

Post by mrh »

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

:)
mrh | cacti 0.8.6h | plugin architecture | thold | monitor | iis6
User avatar
eddy
Posts: 32
Joined: Wed Apr 03, 2002 8:48 am
Location: Mississauga, Ontario

Post by eddy »

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 :o the logs show the errors noted above but the script NEVER gets onto the wire.
User avatar
mrh
Cacti User
Posts: 84
Joined: Tue Mar 08, 2005 9:50 am

Post by mrh »

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 :)
mrh | cacti 0.8.6h | plugin architecture | thold | monitor | iis6
dennett
Posts: 3
Joined: Mon Aug 21, 2006 1:52 am

Post by dennett »

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...
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest