cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 9

Does APM have a monitor to check that an HTTP Source page contains expected code?

Here's an example.  I want to link to say, https://gmail.google.com  If the code below shows up...then Success if any lines are missing, fail and status change.  Thoughts?

 

CODE SNIP EXAMPLE from HTML SOURCE:

html lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="7+ GB of storage, less spam, and mobile access. Gmail is email that's intuitive, efficient, and useful. And maybe even fun.">
<link rel="icon" type="image/ico" href="https://thwack.solarwinds.com//mail.google.com/favicon.ico">
<style type=text/css>
<!--
body,td,div,p,a,font,span {font-family: arial,sans-serif}
body {margin:1em 0;}
h1 { font-size:1.3em; font-weight:normal; margin:0 0 0.4em; }
.intro { margin:0 1em 0.5em 0 }
.c {width: 4; height: 0}
.footer { text-align:center; margin:1em 0 }

.tl {padding: 0; width: 4; text-align: left; vertical-align: top}
.tr {padding: 0; width: 4; text-align: right; vertical-align: top}
.bl {padding: 0; width: 4; text-align: left; vertical-align: bottom}
.br {padding: 0; width: 4; text-align: right; vertical-align: bottom}

.caption {color:#000000; white-space:nowrap; background:#E8EEFA; text-align:center}
.form-noindent {background-color: #ffffff; border: #C3D9FF 1px solid}
.feature-image {padding: 15px 0 0 0; width:48px; vertical-align: top; text-align: right; }
.feature-description {padding: 20px 0 0 10px; vertical-align: top; text-align: left; }
.signup_btn {cursor: pointer; margin: 10px 0 -20px 0; text-align: center; }
.signup_btn_link {color: #000; text-align: center; text-align: center; text-decoration: none; padding: 0 7px; font-weight: bold; font-size: 14px; white-space: nowrap; }

.SPRITE_signup_button_grey_l { background:no-repeat url(https://mail.google.com/mail/help/images/greybtn.png) 0 0; width: 14px; height: 45px }
.SPRITE_signup_button_grey_m { background:no-repeat url(https://mail.google.com/mail/help/images/greybtn.png) -14px 0; height: 45px }
.SPRITE_signup_button_grey_r { background:no-repeat url(https://mail.google.com/mail/help/images/greybtn.png) -365px 0; width: 15px; height: 45px }
.SPRITE_cell {background: no-repeat url(//www.google.com/images/icons/feature/sprite_mail_hp.png) 0 -126px; width: 42px; height: 42px; float: right }
.SPRITE_search_new {background:no-repeat url(//www.google.com/images/icons/feature/sprite_mail_hp.png) 0 -84px; width: 42px; height: 42px; float: right }
.SPRITE_spam_new {background:no-repeat url(//www.google.com/images/icons/feature/sprite_mail_hp.png) 0 -42px; width: 42px; height: 42px; float: right }
.SPRITE_storage {background:no-repeat url(//www.google.com/images/icons/feature/sprite_mail_hp.png) 0 0; width: 42px; height: 42px; float: right }
.SPRITE_feed_icon {background: no-repeat url(//www.google.com/images/icons/feature/sprite_mail_hp.png) -16px -184px; width: 16px; height: 16px }
.SPRITE_corner_bl {background:no-repeat url(https://mail.google.com/mail/help/images/login_corners_sprite.png) 0 0; width: 4px; height: 4px; font-size:2px }
.SPRITE_corner_br {background:no-repeat url(https://mail.google.com/mail/help/images/login_corners_sprite.png) -4px 0; width: 4px; height: 4px; font-size:2px }
.SPRITE_corner_tl {background:no-repeat url(https://mail.google.com/mail/help/images/login_corners_sprite.png) 0 -4px; width: 4px; height: 4px; font-size:2x }
.SPRITE_corner_tr {background:no-repeat url(https://mail.google.com/mail/help/images/login_corners_sprite.png) -4px -4px; width: 4px; height: 4px; font-size:2px }

// -->

 

END SNIP

Tags (2)
0 Kudos
4 Replies
Level 10

is the standard content match on a rendered page sufficient? 

If not you could call any number of the cmdline based http clients from a script and perform your match there.

0 Kudos

I am looking for 100% match and a standard command line http client...like WGET?  I guess though manually manage scripts from the Orion box seems less than appealing to me.  But if that were possible do you have a very specific recommendation?

0 Kudos

i'm haven't had the need to do it but that would likely be the path i'd take.

Actually my first step would be to look at some of the webs vb and powershell script sites to see if anyone has written anything to perform this action and then you would just need to add it to a script monitor in APM.

 I use straight string matches withing http checks on strings that I know will only be there if the page renders as intended.

Is your end goal making sure no one is making changes to your sites without following process? 

0 Kudos

Just wrote this and it seems to work nicely (figured it might come in handy for us too at some point):

Might not be exactly what you want, but will give you an idea.  It basically gets the source, runs a SHA1 hash against it, and then compares that hash to the one passed as an argument (the one you expect it to be).  If they're different, sets Critical to alert.

Andy.

0 Kudos