Page 1 of 1

simple c# expires example?

PostPosted: Mon Sep 26, 2016 12:12 pm
by jriker1
I am trying to pull the expiry date of my account from SD so I can create a custom app that will tell me when I am close to renewal. This app will plug into my nagios monitoring app and warn and then alert me when it's close to renewing. I know I may get an email but rather monitor this myself as well. Can someone provide me the base code in C# that would strictly retrieve the date my account will expire from SD?

Thanks.

JR

Re: simple c# expires example?

PostPosted: Mon Sep 26, 2016 9:14 pm
by rmeden
In this forum there's a mention of a C# example to download data. Just request 30 seconds of data to make it fast, and look in the response for the expiration date.

I also think there's a simple Perl example in this forum (as well as the XMLTV distribution in Perl). Since Nagios is mostly Perl, integration should be easy.

Of course it's overkill... probably best to alarm on a failed data load or reduced data in your application.

Robert

Re: simple c# expires example?

PostPosted: Tue Sep 27, 2016 6:57 am
by jriker1
Thanks I'll give perl a try on the nagios system. Is docs.tms.tribune.com:80 incorrect now? Sample I found makes this call:

my $dd_service='http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl';

I get:

Service description 'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl' can't be loaded: 500 Can't connect to docs.tms.tribune.com:80 (Bad hostname)

Thanks.

JR

Re: simple c# expires example?

PostPosted: Tue Sep 27, 2016 10:25 am
by jriker1
OK I got it now with a different address however what timezone is the data in? My return value is 2017-09-29T21:18:20Z but when calculating the difference between now, if I include the time need to know the timezone.

Thanks.

JR

Re: simple c# expires example?

PostPosted: Tue Sep 27, 2016 8:09 pm
by rmeden
new hostname is dd.schedulesdirect.org
timezone is always UTC

Re: simple c# expires example?

PostPosted: Wed Sep 28, 2016 5:42 am
by jriker1
rmeden wrote:new hostname is dd.schedulesdirect.org
timezone is always UTC


Thanks. Got her working and reporting back, just need to convert my local time to UTC before the final calculation for accuracy.

EDIT: Looks like I don't need to change anything. Perl apparently returns localtime in UTC if you just specific you want now.

Thanks.

Steve