Search 85,949 posts and 653 resources contributed by 43,581 members or post a topic.

Already Joined? Sign in
HTTP component monitor in APM that uses returned value as Statistic?

Page 1 of 1 (5 items) | RSS

rated by 0 users
Answered (Verified) This post has 1 verified answer | 4 Replies | 3 Followers | 188 Views


26 Posts
Points 58
KenKasmar posted on Sun, Jan 31 2010 6:06 PM
rated by 0 users

In trying to leverage APM to collect statistics from actual applications in our environment I need to have an APM component hit a URL via HTTP and use the value returned by the application as the statistic (rather than just verifying the contents and returning the response time).  Is this possible with any out of the box APM component types or am I going to need to do the old 'script monitor that runs a script that does a curl or such, parses the data returned and returns the value' path?

Example:

If it hit a URI string for a server:port that an application listening on like

HTTP://server:12345/CoolApp/HttpHandlerService?Statistic=TransactionsPerSec

that service returns '325' (which would be the statistic that I want to capture for this polling cycle).

Sr Systems Engineer, Enterprise Automation
The Walt Disney Company

Answered (Verified) Verified Answer


12 Posts
Points 42
SolarWinds Employee
Answered (Verified) romkon replied on Mon, Feb 1 2010 2:52 AM
rated by 0 users
Verified by KenKasmar

No out of box APM component does that.

I have created vbscript for you.

It has not been fully tested and is far from being perfect but it does the job (providing that those requested pages don't return html but simple text).

'---------------------------------------------------------------

args = WScript.Arguments.Count

if args <> 1 then
  Wscript.Echo "usage: GetPage.vbs URL"
  wscript.Quit
end if

URL = WScript.Arguments.Item(0)

Set WshShell = WScript.CreateObject("WScript.Shell")

Set http = CreateObject("Microsoft.XmlHttp")

on error resume next

http.open "GET", URL, FALSE
if err <> 0 then  ExitWithError "Page " & URL & " can't be opened"

http.send ""
if err <> 0 then  ExitWithError "Page " & URL & " can't be sent"

on error goto 0

if http.status <> 200 then ExitWithError "Requesting page " & URL & " returned error status: " & http.statusText

ExitWithSucess "Page " & URL & " processed sucesfully", http.responseText

sub ExitWithError(message)
 WScript.Echo "Message: - " & message
 WScript.Echo "Statistic: 0"
    WScript.Quit( 1 )
end sub

sub ExitWithSucess(message, statistics)
 WScript.Echo "Message: - " & message
 WScript.Echo "Statistic: " & statistics
    WScript.Quit( 0 )
end sub

Roman Konecny
APM Development Lead
SolarWinds
  • | Post Points: 23

All Replies


90 Posts
Points 806
SolarWinds Employee
jiri.tomek replied on Mon, Feb 1 2010 2:11 AM
rated by 0 users

Hello Ken,

HTTP monitors can be used only to check if page contains required string or not. If you need to get some data and parse it, you need to create custom script for that.

Jiří Tomek
APM Developer
Solarwinds
Brno, CZ

  • | Post Points: 1

12 Posts
Points 42
SolarWinds Employee
Answered (Verified) romkon replied on Mon, Feb 1 2010 2:52 AM
rated by 0 users
Verified by KenKasmar

No out of box APM component does that.

I have created vbscript for you.

It has not been fully tested and is far from being perfect but it does the job (providing that those requested pages don't return html but simple text).

'---------------------------------------------------------------

args = WScript.Arguments.Count

if args <> 1 then
  Wscript.Echo "usage: GetPage.vbs URL"
  wscript.Quit
end if

URL = WScript.Arguments.Item(0)

Set WshShell = WScript.CreateObject("WScript.Shell")

Set http = CreateObject("Microsoft.XmlHttp")

on error resume next

http.open "GET", URL, FALSE
if err <> 0 then  ExitWithError "Page " & URL & " can't be opened"

http.send ""
if err <> 0 then  ExitWithError "Page " & URL & " can't be sent"

on error goto 0

if http.status <> 200 then ExitWithError "Requesting page " & URL & " returned error status: " & http.statusText

ExitWithSucess "Page " & URL & " processed sucesfully", http.responseText

sub ExitWithError(message)
 WScript.Echo "Message: - " & message
 WScript.Echo "Statistic: 0"
    WScript.Quit( 1 )
end sub

sub ExitWithSucess(message, statistics)
 WScript.Echo "Message: - " & message
 WScript.Echo "Statistic: " & statistics
    WScript.Quit( 0 )
end sub

Roman Konecny
APM Development Lead
SolarWinds
  • | Post Points: 23

26 Posts
Points 58
KenKasmar replied on Mon, Feb 1 2010 3:14 AM
rated by 0 users

Thanks Roman for the fast reply!  That should more or less do the trick!

Any thoughts on the performance impact to NPM and external Pollers if I were to have more than just a few components polling using this 'call VBS' method?  Maybe 7000+ spread over two pollers?

 

Thanks,

Ken

Sr Systems Engineer, Enterprise Automation
The Walt Disney Company

  • | Post Points: 3

12 Posts
Points 42
SolarWinds Employee
romkon replied on Mon, Feb 1 2010 5:30 AM
rated by 0 users

Hi Ken,

well 3500+ for one poller is for default 5min polling frequency 11+ polls per second. vbscript monitor is not designed to be fast but rather versatile. For each poll it creates template file with script content and runs external process 'cscript.exe' to interpret it. None of these is fast.

However, I think, and it is just my guess not supported by enough facts, that this performance impact shall not be critical. It also depends on how much process power is used by NPM polling.

I would strongly suggest to do some performance tests which simulates this. If you found out too much you can lover polling frequency (polling frequency from template is by default inherited in assigned applications so it is one place change).

If you decide to do these test can you please post results.

Regards,

Roman Konecny
APM Development Lead
SolarWinds
  • | Post Points: 1
Page 1 of 1 (5 items) | RSS

© 2003 - 2010 SolarWinds, Inc. All Rights Reserved.

Who is SolarWinds?

SolarWinds is rewriting the rules for how companies manage their networks. Guided by a global community of network engineers, SolarWinds develops simple and powerful network management software and network monitoring software for networks of all sizes. SolarWinds also offers a network certification program to become a SolarWinds Certified Professional (SCP).

What is thwack?

thwack, SolarWinds online community site, was designed by network engineers, for network engineers. thwack is a vibrant, growing community of more than 30,000 IT pros who share a passion for technology.

Explore Resources, Answers, Templates, and Advice

Download Free Networking Tools


Learn More About SolarWinds Products