Is it possible to monitor the RSS feeds of Amazon AWS or Office 365 for keywords? Or outage notifications?
Monitor RSS Feed
Votes:
0
Best Answer
Votes:
2
Got it now :) The sensor consists of three files:
Script: http://pastebin.com/aHX2RfQt
XML Configuration: http://pastebin.com/QbqppESp
Lookup File: http://pastebin.com/a713cPVS
The script goes into the EXEXML folder of the custom sensors, the configuration too. The lookupfile goes into: C:\Program Files (x86)\PRTG Network Monitor\lookups\custom
Make sure the configuration name matches the one in the script (line #14). The config itself and adding new feeds should be self explanatory. When one or more feeds get updated, you will get the latest message(s) in the sensors message field. It will then look somewhat like the screenshot:
8 Replies
Votes:
0
Hello,
thank you very much for your KB-Post. I'm afraid this may only be possible with Custom Exe/Script Sensors in the moment.
best regards.
Votes:
0
Hi, This seems like a good suggestion. I tried to setup a http advanced sensor to monitor http://status.aws.amazon.com/rss/ec2-eu-west-1.rss and alert on changes but the rss feed updates the following causing it to be different every minute:
<pubDate>Wed, 26 Nov 2014 13:18:07 PST</pubDate> <updated>Wed, 26 Nov 2014 13:18:07 PST</updated>
It seems like the http advanced sensor is very close to being able to monitor for RSS feed changes. Is there any way to have it ignore those 2 lines?
Votes:
0
This can't be done with the HTTP Sensors (to ignore the first lines of the feed). You can do it with a custom script sensor. We have an Powershell 1 example here, that you would need to adjust to ignore the first lines of the feed:
# ___ ___ _____ ___ #| _ \ _ \_ _/ __| #| _/ / | || (_ | #|_| |_|_\ |_| \___| # NETWORK MONITOR #------------------- # Description: This script will monitor a RSS feed for updates # Parameters: # - AutoUpdate: Call the script with a sensor with autoupdate = false, let a change notification run the same script after x seconds # with autoupdate true to reset the sensor to okay state # - SensorId - Set it manually _after_ the sensor creation, use %sensorid for this in the notification. This way, you can check multiple feeds :) # ------------------ # (c) 2014 Stephan Linke | Paessler AG param( [int]$autoupdate = 'false' [string]$SensorId = '00001' ) # RSS Reader for PRTG $RssFeedUrl = "https://www.paessler.com" $RssStored = "C:\temp\rss-stored-$SensorId.tmp" $RssLatest = "C:\temp\rss-latest-$SensorId.tmp" # Download the feed $wc = New-Object Net.WebClient $feedContent = $wc.DownloadString($RssFeedUrl) # Store the feed $feedContent | Out-File $rssLatest if(!(Test-Path($rssStored))){ if($autoupdate -eq 'true'){ $feedContent | Out-File $RssStored } } # Get the content into xml object [xml]$StoredContent = get-content $RssStored [xml]$LatestContent = get-content $RssLatest if($StoredContent.rss.channel.item[0].title -eq $LatestContent.rss.channel.item[0].title){ 0:$StoredContent.rss.channel.item[0].title exit 0 } else { 1:"Feed updated: "$LatestContent.rss.channel.item[0].title exit 1 }
Please be aware that the script comes without further warranty and support.
Votes:
0
Hello,
did somebody else test or try it? I did change the param sector and added the colon at the first line so no Parameter Error appears anymore and changed the content false to integer:
param( [int]$autoupdate = '0', [string]$SensorId = '00001' )
Now the C:/temp path does not get found, although it exists and rights are open? Any ideas somebody?
Regards peet
Created on Nov 23, 2015 1:53:04 PM
Last change on Nov 23, 2015 3:08:37 PM by
Torsten Lindner [Paessler Support]
Votes:
0
Sorry I have to revamp the script in order for it to work properly. Sorry for the sloppy code! The rewrite might take a bit, depending on my schedule.
Created on Nov 24, 2015 8:17:58 AM by
Stephan Linke [Paessler Support]
Last change on Nov 24, 2015 10:42:56 AM by
Stephan Linke [Paessler Support]
Votes:
0
Hello Stephan,
no problem, I would do it myself, but I am more of a pseudo-coder than syntxguru, so i'll be waiting.
Did not find other code out there, so I guess a few more people would appreciate this scriptcode of yours - RSS feeds get more and more important to monitor on changes and to have a reliable probe mechanism with escalation and mailing functionalities.
Thanks a million for your efforts.
Regards peet
Votes:
0
Just so you know, I didn't forget you. The script is mostly done, I have to work on the updating mechanism, though :)
Votes:
2
Got it now :) The sensor consists of three files:
Script: http://pastebin.com/aHX2RfQt
XML Configuration: http://pastebin.com/QbqppESp
Lookup File: http://pastebin.com/a713cPVS
The script goes into the EXEXML folder of the custom sensors, the configuration too. The lookupfile goes into: C:\Program Files (x86)\PRTG Network Monitor\lookups\custom
Make sure the configuration name matches the one in the script (line #14). The config itself and adding new feeds should be self explanatory. When one or more feeds get updated, you will get the latest message(s) in the sensors message field. It will then look somewhat like the screenshot:
Add comment