Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


BES (BlackBerry Enterprise Server) template using WMI
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
mrh
Cacti User


Joined: 08 Mar 2005
Posts: 84

PostPosted: Tue May 23, 2006 3:59 am    Post subject: BES (BlackBerry Enterprise Server) template using WMI Reply with quote

Morning cacti community!

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

Cheers



bes_message_queue.png
 Description:
 Filesize:  20.56 KB
 Viewed:  15770 Time(s)

bes_message_queue.png



bes_messages.png
 Description:
 Filesize:  33.43 KB
 Viewed:  15770 Time(s)

bes_messages.png



bes.zip
 Description:
BES graph templates+script

Download
 Filename:  bes.zip
 Filesize:  6.04 KB
 Downloaded:  1444 Time(s)

Back to top
qwertz
Cacti User


Joined: 16 Feb 2006
Posts: 98

PostPosted: Tue May 23, 2006 1:01 pm    Post subject: Reply with quote

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

PostPosted: Tue May 23, 2006 1:20 pm    Post subject: Reply with quote

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

PostPosted: Fri Jun 02, 2006 9:21 am    Post subject: Reply with quote

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

PostPosted: Fri Jun 02, 2006 9:44 am    Post subject: Reply with quote

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

PostPosted: Mon Jun 26, 2006 11:33 am    Post subject: BES VB Script Runs But Cannot Graph...nan Reply with quote

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!



BES_Messages.png
 Description:
BES Messages...nan
 Filesize:  61.44 KB
 Viewed:  15375 Time(s)

BES_Messages.png


Back to top
AndyStewart
Cacti User


Joined: 29 Sep 2005
Posts: 102
Location: Edinburgh, Scotland

PostPosted: Tue Jun 27, 2006 3:05 am    Post subject: Reply with quote

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

PostPosted: Wed Jun 28, 2006 8:10 am    Post subject: Reply with quote

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

PostPosted: Wed Jun 28, 2006 3:02 pm    Post subject: Reply with quote

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

PostPosted: Wed Jul 12, 2006 5:14 pm    Post subject: Reply with quote

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

PostPosted: Wed Jul 19, 2006 12:30 pm    Post subject: Post subject: BES (BlackBerry Enterprise Server) template us Reply with quote

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

PostPosted: Tue Aug 29, 2006 7:52 am    Post subject: Reply with quote

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

PostPosted: Tue Aug 29, 2006 3:12 pm    Post subject: Reply with quote

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

PostPosted: Tue Sep 19, 2006 9:04 am    Post subject: Reply with quote

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

PostPosted: Tue Oct 17, 2006 10:58 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group