Hyperspin Presales & Support Forum Index Hyperspin Presales & Support

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

RSS parser script

 
Post new topic   Reply to topic    Hyperspin Presales & Support Forum Index -> Technical Support
View previous topic :: View next topic  
Author Message
adamneal



Joined: 13 Aug 2006
Posts: 7

PostPosted: Sun Aug 13, 2006 4:37 am    Post subject: RSS parser script Reply with quote

Hello,

Firstly apologies if I've posted this in the wrong place.

I've just spent an hour or so putting together a PHP class that will parse the RSS feed from hyperspin. I thought I would post it here for others to use as I've seen a few questions asking how to do it. The class provides the basic fields from the RSS feed and also provides the following:

Total outages (curr month/prev month/all time)
Total downtime (curr month/prev month/all time)

Averages across all servers:
Uptime (curr month/prev month/all time)
Downtime (curr month/prev month/all time)
Outages (curr month/prev month/all time)

Examples of the data produced can be seen at:

Example report using a mocked up rss feed to simulate multiple servers

My live feed (only one server hence the need for a mocked up report)

My live feed integrataed into the site

The mocked up report uses fabricated data so the percentage numbers wont necessarily be right but the calculated averages based on this data are correct.

The example included should be self explanatory from comments in the code. If no URL is set it uses the Hyperspin Testdrive feed, however this feed does not provide all the data so you may notice some missing blocks and PHP notices in your error log. To stop these simply remove the missing statistics from the display section in reportExample.php.

This code is free for anyone to use, I would appreciate it if you would leave the headers intact though. Any comments/suggestions for improvements are greatly received either by email (found in the source) or on here. If you require extra guidance in the use of this then it's probably best to post here so all users benefit. The code has been tested and works as far as I can tell, however I'm only human so it is possible there may be bugs present Smile Please let me know if you find any.

Adam

Files:

http://www.amnwebtech.co.uk/hyperspin/rssParser.tar.gz
http://www.amnwebtech.co.uk/hyperspin/rssParser.zip

(Edit: Added link to the report integrated into the site)


Last edited by adamneal on Sat Aug 19, 2006 1:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
choonkeng
Site Admin


Joined: 11 Sep 2005
Posts: 321

PostPosted: Sun Aug 13, 2006 5:24 am    Post subject: Reply with quote

Dear Adam,

Thank you so much for sharing your work. Many members here will find it useful, so I made it sticky Smile

Thanks again.
Back to top
View user's profile Send private message
adamneal



Joined: 13 Aug 2006
Posts: 7

PostPosted: Sun Aug 13, 2006 5:35 am    Post subject: Reply with quote

Not a problem choonkeng. Would it be possible to turn on all the options on the testdrive report? This would allow me to show a more meaningful example than the one I mocked up.

Adam
Back to top
View user's profile Send private message
choonkeng
Site Admin


Joined: 11 Sep 2005
Posts: 321

PostPosted: Sun Aug 13, 2006 6:03 am    Post subject: Reply with quote

Adam,

I would love to help, but turning on all options will make the sample report too verbose and hard to read, so I prefer to leave it that way.

May I suggest you also add the notice about possible missing blocks and PHP notices into reportExample.php, right before new hyperspinRSSParser(). This way, other users are warned and they can experiment with their own reports to see the full capability of your script.

Thanks.
Back to top
View user's profile Send private message
adamneal



Joined: 13 Aug 2006
Posts: 7

PostPosted: Sun Aug 13, 2006 6:17 am    Post subject: Reply with quote

Ok, no problem. I've made the changes you suggested to the source code
Back to top
View user's profile Send private message
UH-Matt



Joined: 28 Feb 2007
Posts: 2

PostPosted: Wed Feb 28, 2007 2:06 am    Post subject: Reply with quote

Adam

Any chance you could help me adjust this script?

I want to add a "click here" column to provide a link to each servers public report.

Any help appreciated... im no good with PHP..
Back to top
View user's profile Send private message
adamneal



Joined: 13 Aug 2006
Posts: 7

PostPosted: Wed Feb 28, 2007 4:53 am    Post subject: Reply with quote

Matt,

Not a problem, I've sent you a PM back. I'll probably post the changes on here as I think it will be useful for most people
Back to top
View user's profile Send private message
adamneal



Joined: 13 Aug 2006
Posts: 7

PostPosted: Mon Jul 23, 2007 11:13 am    Post subject: New version Reply with quote

Hi everyone,

I've updated hyperspinRSSParser.class.php as it had a bug for when the downtime values went over one hour. I'd suggest updating to the latest version, the links in the first post now point to the latest files

Adam
Back to top
View user's profile Send private message
choonkeng
Site Admin


Joined: 11 Sep 2005
Posts: 321

PostPosted: Mon Jul 23, 2007 11:23 am    Post subject: Reply with quote

Thanks Adam, your script has benefited many people Smile
Back to top
View user's profile Send private message
adamneal



Joined: 13 Aug 2006
Posts: 7

PostPosted: Mon Jul 23, 2007 11:29 am    Post subject: Reply with quote

Not a problem, I probably should have added that the notes field is now included in the parsing as well, the example file has been updated to show how to use it.

Enjoy!
Back to top
View user's profile Send private message
UH-Matt



Joined: 28 Feb 2007
Posts: 2

PostPosted: Wed Aug 29, 2007 10:20 am    Post subject: Reply with quote

Adam thanks for your work on this.

Its fantastic!
Back to top
View user's profile Send private message
adamneal



Joined: 13 Aug 2006
Posts: 7

PostPosted: Mon Jun 09, 2008 8:07 am    Post subject: Update Reply with quote

I've made a small update to the script so that the Average results that are returned by the RSS feed aren't counted as an actual server. If people are updating you just need to copy the hyperspinRSSParser.class.php to the includes folder

Adam
Back to top
View user's profile Send private message
choonkeng
Site Admin


Joined: 11 Sep 2005
Posts: 321

PostPosted: Mon Jun 09, 2008 12:10 pm    Post subject: Reply with quote

Thanks so much, Adam.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Hyperspin Presales & Support Forum Index -> Technical Support All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group