I'm trying to use PRTG to monitor twitter accounts, and have got a tool generating RSS feeds of the twitter accounts I'm interested in.
I've written a PowerShell script to parse the RSS file into XML for the EXE/XML custom sensor, which successfully populates the message field of the sensor with the text of the latest tweet that account has sent.
However even with content change enabled and content change notifications enabled, if the message changes, the sensor does not trigger a content changed notification.
Is there a way of configuring this or would this have to become a feature request?
Thanks!
Article Comments
That's a shame. Given the value extracted by the query is in fact a string, is it possible to at least have the logic within PRTG notice that the string has changed, even if, because it is a string, the value reported remains at 0.
There's two ways of interrogating RSS - I used XML in the end, which I used the following parameters on: URL: URL to RSS feed XML Node: rss/channel/item[1]/description (this gives you the first entry, change the number in square brackets to pull out a different value) You need to enable 'use namespaces' on this.
The other way is using a PowerShell script as a custom EXE/XML sensor, passing the RSS URL as an argument to the script (e.g. Script.ps1 http://URLtoRSSfeed)
Param( [string]$urlToCheck ) $url = $urlToCheck $wc = New-Object net.webclient [xml]$xml = $wc.DownloadString($url) $retXml = "<prtg>`n" $retXml += "<result>`n" $retXml += "<channel>Latest tweet</channel>`n" $retXml += "<value>",$xml.rss.channel.item[0].Title,"</value>`n" $retXml += "</result>`n" $retXml += "<text>",$xml.rss.channel.item[0].Title,"</text>`n" $retXml += "<result>`n" $retXml += "<channel>Link to latest tweet</channel>`n" $retXml += "<value>",$xml.rss.channel.item[0].Link,"</value>`n" $retXml += "</result>`n" $retXml += "</prtg>" # Return Info write-host $retXml exit 0
Apr, 2014 - Permalink
If you use Powershell to do a string comparison and then have the number result of one of the channels change when there is a string change, you would be able to use the change trigger but unfortunately PRTG cannot compare the last message field at this time.
Apr, 2014 - Permalink
Unfortunately there is no way for PRTG to compare the last message values, it can only compare values for the data that is in the sensors so in your case you would need to program this to change the data in the channel for the sensor to go into an error status.
As a side note, would you mind posting up the code that you use for this function? It seems like something that would interest our other customers :D
Apr, 2014 - Permalink