Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Thu Mar 28, 2024 8:00 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
 Post subject: Dell Warranty view
PostPosted: Sat Jan 17, 2009 1:23 am 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
I just coded a Dell warranty view, to see this update to the latest SVN. (1118)

This required a few changes in various places since it calculates things from an external web site.

The view looks up the warranty in real time, and is therefore as slow as your internet connection :roll:
$show_dell_warranty = 'y' ; must be set in your include_config.php (it is set to $show_dell_warranty = 'n' ; in include_config_defaults.php because it is very much Beta).

Don't try to sort by warranty days, it wont work, 'cos this is not a database field. (Any suggestions as to how to do this?)

I thought of injecting this information back to the database the first time the page is loaded, and using the database for each subsequent change of view.

An alternative method would be to set a warranty date flag in the database, and only do the draw down from the dell website if the date differs from the one posted to the database. This would restrict web updates to one per day, and vastly speed up the whole process.

This would involve an intermediate page load to do the updating, (Please wait, updating warranty details....) followed by loading a standard viewdef.
I cant simply rely on reading the warranty date in to the database once, as extended warranty may be purchased with out updating our database.

Let me know what you all think.

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Sat Jan 17, 2009 5:44 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Please note none of the Dell php pages are in SVN. Also I receive a \images\equipment error at top of page.

thanks

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Sat Jan 17, 2009 8:04 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
:oops: Try it now...

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Mon Jan 19, 2009 4:58 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Hi,

When I change to US info page all systems show days as 0

In addition the correct URL for US should be:

[code]
$this_url="http://support.dell.com/support/topics/global.aspx/support/my_systems_info/en/details?c=us&cs=usbsdt1&servicetag=";
[/code]

I also notice the query in the viewdef looks for system vendor = to Dell Inc. or Dell Corporation. An addition filter would be if service tag is length is less than or equal to 7 characthers then also include OR if service tag is greater that 7 characthers then do not include.

I have some VMs where i include the SMBIOS.reflect=true which essentially changes the VM to appear to have same charactheristic as the host. It does not reflect the service tag though. In cases like this I get an error on the viewdef page like so:

[code]
Warning: file_get_contents(http://support.dell.com/support/topics/global.aspx/support/my_systems_info/en/details?c=us&cs=usbsdt1&servicetag=VMware-50 0e ed c3 d6 f9 9c 9b-c6 9f 1b 43 29 55 79 68) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in C:\xampp\htdocs\openaudit\include_dell_warranty_functions.php on line 141

Warning: stripos() [function.stripos]: Offset not contained in string. in C:\xampp\htdocs\openaudit\include_dell_warranty_functions.php on line 83

Warning: stripos() [function.stripos]: Offset not contained in string. in C:\xampp\htdocs\openaudit\include_dell_warranty_functions.php on line 86

Warning: stripos() [function.stripos]: Offset not contained in string. in C:\xampp\htdocs\openaudit\include_dell_warranty_functions.php on line 87
[/code]

By the way I LOVE THIS FEATURE!!! we should also look to include the start and end warranty dates!

Thanks,

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Mon Jan 19, 2009 6:43 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
[quote="jsingh"]Hi,

When I change to US info page all systems show days as 0 [color=#FF0000] <==== Didn't check it with the US page, but I suspect it will work, however it will need a bit of tinkering. [/color]

In addition the correct URL for US should be:

[code]
$this_url="http://support.dell.com/support/topics/global.aspx/support/my_systems_info/en/details?c=us&cs=usbsdt1&servicetag=";
[/code]

I also notice the query in the viewdef looks for system vendor = to Dell Inc. or Dell Corporation. An addition filter would be if service tag is length is less than or equal to 7 characthers then also include OR if service tag is greater that 7 characthers then do not include[color=#FF0000]. <== It was coded in a bit of a hurry, so any refinements would be welcome. [/color]

I have some VMs where i include the SMBIOS.reflect=true which essentially changes the VM to appear to have same charactheristic as the host. It does not reflect the service tag though. In cases like this I get an error on the viewdef page like so:

[code]
Warning: file_get_contents(http://support.dell.com/support/topics/global.aspx/support/my_systems_info/en/details?c=us&cs=usbsdt1&servicetag=VMware-50 0e ed c3 d6 f9 9c 9b-c6 9f 1b 43 29 55 79 68) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in C:\xampp\htdocs\openaudit\include_dell_warranty_functions.php on line 141

Warning: stripos() [function.stripos]: Offset not contained in string. in C:\xampp\htdocs\openaudit\include_dell_warranty_functions.php on line 83

Warning: stripos() [function.stripos]: Offset not contained in string. in C:\xampp\htdocs\openaudit\include_dell_warranty_functions.php on line 86

Warning: stripos() [function.stripos]: Offset not contained in string. in C:\xampp\htdocs\openaudit\include_dell_warranty_functions.php on line 87
[/code]

By the way I LOVE THIS FEATURE!!! we should also look to include the start and end warranty dates! [color=#FF0000]<== :D Glad you like it![/color]

Thanks,

Jason

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Mon Jan 19, 2009 10:20 pm 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Hi,

Two other points.

It would be good to enumerate the the table looking for:

1. Type of warranty
2. Time left on warranty

Example: We buy an Optiplex that comes with 1 yr. Next Business Warranty as standard, then we add 2 additional years, for a total of 3 years NBD warranty.

Example 2: We buy a Poweredge that comes with 1 yr. 4hr. warranty as standard, then we add 2 additional years, for a total of 3 years 4 hr. warranty.

These both examples show up as line items on the warranty page.

Might be good to include the start and end dates on the viewdef page as well. Then we can maybe do, if warranty has less than x amount of days then display the row in RED to highlight it?

What do you think?

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Tue Jan 20, 2009 11:06 am 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
:D :idea: Good points Jason, we would need to make the "GET" code a bit more sophisticated, might be worth coding it with proper html/xml parsing rather than simply looking for a particular field on the page. As I said I coded this in a bit of a "get it working quick" :oops: style as I needed the info that afternoon. There's bound to be a better way of parsing the dell web page, but this was a quick and dirty hack that got the job done.

I think there is a php xml parse class, so we could use that to parse the content part of the page into its tagged sections, and then grab all of the data from this to an array. We could then push this to data to the OA database as per my previous post. Any other thoughts?

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Wed Jan 21, 2009 10:38 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
This sounds good. Any way I can help?

Please advise.

Thanks!

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Wed Jan 21, 2009 10:29 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Well the function function get_dell_warranty_days ( $this_serial_number) in include_dell_warranty.php does the decoding of the dell warranty, so what we need to do is recode this, and create a few more functions to get the other info we need.

Since the warranty info is probably going to be returned as an array, we also need to work out how to fetch the array using either the functions described in my previous post, or a function of our own devising. This info then needs pushed to the database, before loading the actual viewdef. I am unlikely to be able to code any of this in the next week or so as I am assisting with a big move at the moment, so any help would be appreciated.

I would start by trying to grab the data from the warranty page in to an array, with a new function get_dell_warranty_array() which we can then use to enhance get_dell_warranty_days () and with these we should be most of the way to being able to post back to the database. The recoding of the viewdef should be fairly trivial, but depends on these components being in place.

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Wed Jan 28, 2009 11:02 pm 
Any requests to the Dell website need to be done offline, we have over 4000 Dell PCs on site,although I've haven't tried the link, I suspect that it would take too long to get the details for it to be usable. I wrote a vb script a while ago to do this, what I did was just to copy the lines from the warranty table on the web page to a local database. It is not straightforward to work out by script exactly how much warranty is left, as there are many categories of warranty, not all expiring at the same time. I just display them for the user and let them work it out.


Top
  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Wed Jan 28, 2009 11:47 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
[quote="jbsclm"]Any requests to the Dell website need to be done offline, we have over 4000 Dell PCs on site,although I've haven't tried the link, I suspect that it would take too long to get the details for it to be usable. I wrote a vb script a while ago to do this, what I did was just to copy the lines from the warranty table on the web page to a local database. It is not straightforward to work out by script exactly how much warranty is left, as there are many categories of warranty, not all expiring at the same time. I just display them for the user and let them work it out.



You are quite correct, 4000 hits to the dell web site would take a long time, hence my suggestion that there be an intermediate page which updates the database if it hasn't been updated that day, before loading the view. The view would then use the data from the local OA database and only update from the web if required or requested.

Calculating warranty is complicated as you say by the fact that some items have more than one warranty, and indeed Dell is not the only warranty provider.

I simply needed a list of all systems which were out of warranty, or nearly out of warranty, and for the 2 to 3 hundred machines I have, the page works reasonably well.

Any coding enhancements would be welcome. :P

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
 Post subject: Re: Dell Warranty view
PostPosted: Fri Feb 13, 2009 6:38 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Hi,

An intermediate page/cache would be best. for arguments sake let's call it dell_warranty.xml

this would include a tree like:
[code]
dell_warranties
-dell_tag
-originalwarranty
-startdate
-enddate
-daysleft
-/originalwarranty
-extendedwarranty
-startdate
-enddate
-daysleft
-/extendedwarranty
-/dell_tag
-/dell_warranties
[/code]
With that info, we can use a timestamp with a scheduled job to call an update after x time
we can also use the XML for dynamic queries where the viewdef page for example, can simply show remaining time (daysleft from original + daysleft from extended)

Me coding this will be long and tough.

Thanks,

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group