Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Jun 25, 2019 4:50 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: BES (BlackBerry Enterprise Server) template using WMI
PostPosted: Tue May 23, 2006 3:59 am 
Offline
Cacti User
User avatar

Joined: Tue Mar 08, 2005 9:50 am
Posts: 84
Morning cacti community!

I've wrote a VBS script to get BES statistics with WMI. Enjoy it :)

Cheers


Attachments:
bes_message_queue.png
bes_message_queue.png [ 20.56 KiB | Viewed 40737 times ]
bes_messages.png
bes_messages.png [ 33.43 KiB | Viewed 40737 times ]
File comment: BES graph templates+script
bes.zip [6.04 KiB]
Downloaded 3222 times

_________________
mrh | cacti 0.8.6h | plugin architecture | thold | monitor | iis6
Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 1:01 pm 
Offline
Cacti User

Joined: Thu Feb 16, 2006 9:20 am
Posts: 98
Thanks



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

Qwertz


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 1:20 pm 
Offline
Cacti User
User avatar

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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 02, 2006 9:21 am 
Offline
Cacti User

Joined: Mon Nov 29, 2004 11:34 am
Posts: 67
You can do the same thing in linux using the nsclient in windows (or similar client) by polling the perfmon values with check_nt.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 02, 2006 9:44 am 
Offline
Cacti User
User avatar

Joined: Thu Sep 29, 2005 5:21 am
Posts: 102
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...

_________________
I don't care if the glass is half full or half empty, i want to know, who's been drinking my pint!!!

[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]


Top
 Profile  
 
 Post subject: BES VB Script Runs But Cannot Graph...nan
PostPosted: Mon Jun 26, 2006 11:33 am 
Offline

Joined: Tue Apr 12, 2005 11:28 am
Posts: 3
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:
File comment: BES Messages...nan
BES_Messages.png
BES_Messages.png [ 61.44 KiB | Viewed 40342 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 3:05 am 
Offline
Cacti User
User avatar

Joined: Thu Sep 29, 2005 5:21 am
Posts: 102
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.

_________________
I don't care if the glass is half full or half empty, i want to know, who's been drinking my pint!!!

[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]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 28, 2006 8:10 am 
Offline
Cacti User
User avatar

Joined: Thu Sep 29, 2005 5:21 am
Posts: 102
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.

_________________
I don't care if the glass is half full or half empty, i want to know, who's been drinking my pint!!!

[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]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 28, 2006 3:02 pm 
Offline

Joined: Tue Apr 12, 2005 11:28 am
Posts: 3
Good work! I changed the data input source to the /nologo and everything is working great now. Thanks for the fix!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 12, 2006 5:14 pm 
Offline

Joined: Fri Jun 09, 2006 12:56 pm
Posts: 33
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.


Top
 Profile  
 
 Post subject: Post subject: BES (BlackBerry Enterprise Server) template us
PostPosted: Wed Jul 19, 2006 12:30 pm 
Offline
User avatar

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 29, 2006 7:52 am 
Offline
Cacti User
User avatar

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 29, 2006 3:12 pm 
Offline
User avatar

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 9:04 am 
Offline
Cacti User
User avatar

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 17, 2006 10:58 pm 
Offline

Joined: Mon Aug 21, 2006 1:52 am
Posts: 3
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...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group