1
0
mirror of https://github.com/Napsty/check_esxi_hardware.git synced 2024-10-22 12:13:46 +02:00

Update for new Dell Support URLs

Updated Dell support urls for product and service tag links
This commit is contained in:
Phil Randal 2013-07-25 14:07:15 +01:00
parent dddaab0f3b
commit dd420fc96a

View File

@ -199,6 +199,10 @@
#@ Author : Carl R. Friend #@ Author : Carl R. Friend
#@ Reason : Improving wrong authentication timeout and exit UNKNOWN #@ Reason : Improving wrong authentication timeout and exit UNKNOWN
#@--------------------------------------------------- #@---------------------------------------------------
#@ Date : 20130725
#@ Author : Phil Randal (phil.randal@gmail.com)
#@ Reason : Fix lookup of warranty info for Dell
#@---------------------------------------------------
import sys import sys
import time import time
@ -207,7 +211,7 @@ import re
import string import string
from optparse import OptionParser,OptionGroup from optparse import OptionParser,OptionGroup
version = '20130702' version = '20130725'
NS = 'root/cimv2' NS = 'root/cimv2'
@ -307,18 +311,79 @@ ExitWarning = 1
ExitCritical = 2 ExitCritical = 2
ExitUnknown = 3 ExitUnknown = 3
def dell_country(country):
if country == 'at': # Austria
return 'at/de/'
if country == 'be': # Belgium
return 'be/nl/'
if country == 'cz': # Czech Republic
return 'cz/cs/'
if country == 'de': # Germany
return 'de/de/'
if country == 'dk': # Denmark
return 'dk/da/'
if country == 'es': # Spain
return 'es/es/'
if country == 'fi': # Finland
return 'fi/fi/'
if country == 'fr': # France
return 'fr/fr/'
if country == 'gr': # Greece
return 'gr/en/'
if country == 'it': # Italy
return 'it/it/'
if country == 'il': # Israel
return 'il/en/'
if country == 'me': # Middle East
return 'me/en/'
if country == 'no': # Norway
return 'no/no/'
if country == 'nl': # The Netherlands
return 'nl/nl/'
if country == 'pl': # Poland
return 'pl/pl/'
if country == 'pt': # Portugal
return 'pt/en/'
if country == 'ru': # Russia
return 'ru/ru/'
if country == 'se': # Sweden
return 'se/sv/'
if country == 'uk': # United Kingdom
return 'uk/en/'
if country == 'za': # South Africa
return 'za/en/'
if country == 'br': # Brazil
return 'br/pt/'
if country == 'ca': # Canada
return 'ca/en/'
if country == 'mx': # Mexico
return 'mx/es/'
if country == 'us': # United States
return 'us/en/'
if country == 'au': # Australia
return 'au/en/'
if country == 'cn': # China
return 'cn/zh/'
if country == 'in': # India
return 'in/en/'
# default
return 'en/us/'
def urlised_server_info(vendor, country, server_info): def urlised_server_info(vendor, country, server_info):
#server_inf = server_info #server_inf = server_info
if vendor == 'dell' : if vendor == 'dell' :
# Dell support URLs (idea and tables borrowed from check_openmanage) # Dell support URLs (idea and tables borrowed from check_openmanage)
du = 'http://support.dell.com/support/edocs/systems/pe' du = 'http://www.dell.com/support/troubleshooting/' + dell_country(country) + '19/Product/poweredge-'
if (server_info is not None) : if (server_info is not None) :
p=re.match('(.*)PowerEdge (.*) (.*)',server_info) p=re.match('(.*)PowerEdge (.*) (.*)',server_info)
if (p is not None) : if (p is not None) :
md=p.group(2) modelname=p.group(3)
if (re.match('M',md)) : if modelname == 'R210 II':
md = 'm' md='r210-2'
server_info = p.group(1) + '<a href="' + du + md + '/">PowerEdge ' + p.group(2)+'</a> ' + p.group(3) else:
md=p.group(2)
md=md.lower()
server_info = p.group(1) + '<a href="' + du + md + '#ui-tabs-4">PowerEdge ' + p.group(2)+'</a> ' + p.group(3)
elif vendor == 'hp': elif vendor == 'hp':
return server_info return server_info
elif vendor == 'ibm': elif vendor == 'ibm':
@ -331,50 +396,18 @@ def urlised_server_info(vendor, country, server_info):
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
def system_tag_url(vendor,country): def system_tag_url(vendor,country):
url = {'xx':''}
if vendor == 'dell': if vendor == 'dell':
# Dell support sites # Dell support sites
supportsite = 'http://www.dell.com/support/troubleshooting/' supportsite = 'http://www.dell.com/support/troubleshooting/'
dellsuffix = 'nodhs1/Index?t=warranty&servicetag=' dellsuffix = 'nodhs1/Index?t=warranty&servicetag='
# warranty URLs for different country codes # warranty URLs for different country codes
# EMEA return supportsite + dell_country(country) + dellsuffix
url['at'] = supportsite + 'at/de/' + dellsuffix # Austria
url['be'] = supportsite + 'be/nl/' + dellsuffix # Belgium
url['cz'] = supportsite + 'cz/cs/' + dellsuffix # Czech Republic
url['de'] = supportsite + 'de/de/' + dellsuffix # Germany
url['dk'] = supportsite + 'dk/da/' + dellsuffix # Denmark
url['es'] = supportsite + 'es/es/' + dellsuffix # Spain
url['fi'] = supportsite + 'fi/fi/' + dellsuffix # Finland
url['fr'] = supportsite + 'fr/fr/' + dellsuffix # France
url['gr'] = supportsite + 'gr/en/' + dellsuffix # Greece
url['it'] = supportsite + 'it/it/' + dellsuffix # Italy
url['il'] = supportsite + 'il/en/' + dellsuffix # Israel
url['me'] = supportsite + 'me/en/' + dellsuffix # Middle East
url['no'] = supportsite + 'no/no/' + dellsuffix # Norway
url['nl'] = supportsite + 'nl/nl/' + dellsuffix # The Netherlands
url['pl'] = supportsite + 'pl/pl/' + dellsuffix # Poland
url['pt'] = supportsite + 'pt/en/' + dellsuffix # Portugal
url['ru'] = supportsite + 'ru/ru/' + dellsuffix # Russia
url['se'] = supportsite + 'se/sv/' + dellsuffix # Sweden
url['uk'] = supportsite + 'uk/en/' + dellsuffix # United Kingdom
url['za'] = supportsite + 'za/en/' + dellsuffix # South Africa
# America
url['br'] = supportsite + 'br/pt/' + dellsuffix # Brazil
url['ca'] = supportsite + 'ca/en/' + dellsuffix # Canada
url['mx'] = supportsite + 'mx/es/' + dellsuffix # Mexico
url['us'] = supportsite + 'us/en/' + dellsuffix # USA
# Asia/Pacific
url['au'] = supportsite + 'au/en/' + dellsuffix # Australia
url['cn'] = supportsite + 'cn/zh/' + dellsuffix # China
url['in'] = supportsite + 'in/en/' + dellsuffix # India
# default fallback
url['xx'] = supportsite + 'us/en/' + dellsuffix # default
# elif vendor == 'hp': # elif vendor == 'hp':
# elif vendor == 'ibm': # elif vendor == 'ibm':
# elif vendor == 'intel': # elif vendor == 'intel':
return url.get(country,url['xx']) return ''
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------