mirror of
https://github.com/Napsty/check_esxi_hardware.git
synced 2026-02-06 15:15:20 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
489da3de76 | ||
|
|
bcf607b2cb | ||
|
|
ff3228b804 | ||
|
|
08cf10de24 |
77
.github/workflows/python2check.yml
vendored
Normal file
77
.github/workflows/python2check.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# @file python2check.yml
|
||||||
|
---
|
||||||
|
name: Python2 check
|
||||||
|
|
||||||
|
# Trigger the workflow on push or pull request
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
python2-pywbem08:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: '2.7'
|
||||||
|
- name: Install pywbem from apt
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -qq -yy python-pywbem
|
||||||
|
- name: Set environment PYTHONPATH
|
||||||
|
run: |
|
||||||
|
export PYTHONPATH=/opt/hostedtoolcache/Python
|
||||||
|
- name: Launch script with --help
|
||||||
|
run: |
|
||||||
|
./check_esxi_hardware.py --help
|
||||||
|
|
||||||
|
# Jobs with PIP installations are currently disabled.
|
||||||
|
# python2-pywbem09:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v1
|
||||||
|
# - uses: actions/setup-python@v1
|
||||||
|
# with:
|
||||||
|
# python-version: '2.7'
|
||||||
|
# - name: Install latest pywbem from pip
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get install -qq -yy python-pip
|
||||||
|
# pip install pywbem==0.9.1
|
||||||
|
# - name: Set environment PYTHONPATH
|
||||||
|
# run: |
|
||||||
|
# export PYTHONPATH=/opt/hostedtoolcache/Python
|
||||||
|
# - name: Launch script with --help
|
||||||
|
# run: |
|
||||||
|
# ./check_esxi_hardware.py --help
|
||||||
|
# python2-pywbem012:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v1
|
||||||
|
# - uses: actions/setup-python@v1
|
||||||
|
# with:
|
||||||
|
# python-version: '2.7'
|
||||||
|
# - name: Install latest pywbem from pip
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get install -qq -yy python-pip
|
||||||
|
# pip install pywbem==0.12.6
|
||||||
|
# - name: Set environment PYTHONPATH
|
||||||
|
# run: |
|
||||||
|
# export PYTHONPATH=/opt/hostedtoolcache/Python
|
||||||
|
# - name: Launch script with --help
|
||||||
|
# run: |
|
||||||
|
# ./check_esxi_hardware.py --help
|
||||||
|
# python2-pywbem014:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v1
|
||||||
|
# - uses: actions/setup-python@v1
|
||||||
|
# with:
|
||||||
|
# python-version: '2.7'
|
||||||
|
# - name: Install latest pywbem from pip
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get install -qq -yy python-pip
|
||||||
|
# pip install pywbem==0.14.6
|
||||||
|
# - name: Set environment PYTHONPATH
|
||||||
|
# run: |
|
||||||
|
# export PYTHONPATH=/opt/hostedtoolcache/Python
|
||||||
|
# - name: Launch script with --help
|
||||||
|
# run: |
|
||||||
|
# ./check_esxi_hardware.py --help
|
||||||
114
.github/workflows/python3check.yml
vendored
Normal file
114
.github/workflows/python3check.yml
vendored
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
# @file python3check.yml
|
||||||
|
---
|
||||||
|
name: Python3 check
|
||||||
|
|
||||||
|
# Trigger the workflow on push or pull request
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
simple-output:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Simple hello world
|
||||||
|
run: echo "Hello World"
|
||||||
|
# python3-pywbem-latest:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v1
|
||||||
|
# - uses: actions/setup-python@v1
|
||||||
|
# with:
|
||||||
|
# python-version: '3.8'
|
||||||
|
# - name: Install latest pywbem from pip
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get install -qq -yy python3-pip
|
||||||
|
# pip3 install pywbem
|
||||||
|
# - name: Set environment PYTHONPATH
|
||||||
|
# run: |
|
||||||
|
# export PYTHONPATH=/opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages
|
||||||
|
# - name: Verify python sys.path
|
||||||
|
# run: (echo "import sys"; echo "print(', '.join(sys.path))") | python
|
||||||
|
# - name: Launch script with --help
|
||||||
|
# run: |
|
||||||
|
# ./check_esxi_hardware.py --help
|
||||||
|
# python3-pywbem-08:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v1
|
||||||
|
# - uses: actions/setup-python@v1
|
||||||
|
# with:
|
||||||
|
# python-version: '3.x'
|
||||||
|
# - name: Install latest pywbem from pip
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get install -qq -yy python3-pip
|
||||||
|
# pip3 install pywbem==0.8.4
|
||||||
|
# - name: Set environment PYTHONPATH
|
||||||
|
# run: |
|
||||||
|
# export PYTHONPATH=/opt/hostedtoolcache/Python
|
||||||
|
# - name: Launch script with --help
|
||||||
|
# run: |
|
||||||
|
# ./check_esxi_hardware.py --help
|
||||||
|
# python3-pywbem-012:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v1
|
||||||
|
# - uses: actions/setup-python@v1
|
||||||
|
# with:
|
||||||
|
# python-version: '3.x'
|
||||||
|
# - name: Install latest pywbem from pip
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get install -qq -yy python3-pip
|
||||||
|
# pip3 install pywbem==0.12.6
|
||||||
|
# - name: Set environment PYTHONPATH
|
||||||
|
# run: |
|
||||||
|
# export PYTHONPATH=/opt/hostedtoolcache/Python
|
||||||
|
# - name: Launch script with --help
|
||||||
|
# run: |
|
||||||
|
# ./check_esxi_hardware.py --help
|
||||||
|
# python3-pywbem-013:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v1
|
||||||
|
# - uses: actions/setup-python@v1
|
||||||
|
# with:
|
||||||
|
# python-version: '3.x'
|
||||||
|
# - name: Install latest pywbem from pip
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get install -qq -yy python3-pip
|
||||||
|
# pip3 install pywbem==0.13.1
|
||||||
|
# - name: Set environment PYTHONPATH
|
||||||
|
# run: |
|
||||||
|
# export PYTHONPATH=/opt/hostedtoolcache/Python
|
||||||
|
# - name: Launch script with --help
|
||||||
|
# run: |
|
||||||
|
# ./check_esxi_hardware.py --help
|
||||||
|
# python3-pywbem-014:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v1
|
||||||
|
# - uses: actions/setup-python@v1
|
||||||
|
# with:
|
||||||
|
# python-version: '3.x'
|
||||||
|
# - name: Install latest pywbem from pip
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get install -qq -yy python3-pip
|
||||||
|
# pip3 install pywbem==0.14.6
|
||||||
|
# - name: Set environment PYTHONPATH
|
||||||
|
# run: |
|
||||||
|
# export PYTHONPATH=/opt/hostedtoolcache/Python
|
||||||
|
# - name: Launch script with --help
|
||||||
|
# run: |
|
||||||
|
# ./check_esxi_hardware.py --help
|
||||||
|
# find-pywbem:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v1
|
||||||
|
# - uses: actions/setup-python@v1
|
||||||
|
# with:
|
||||||
|
# python-version: '3.x'
|
||||||
|
# - name: Install latest pywbem from pip
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get install -qq -yy python-pip
|
||||||
|
# pip install pywbem
|
||||||
|
# - name: Find pywbem module
|
||||||
|
# run: |
|
||||||
|
# find / -name 'pywbem-*'
|
||||||
@@ -264,6 +264,9 @@
|
|||||||
#@ Author : Claudio Kuenzler
|
#@ Author : Claudio Kuenzler
|
||||||
#@ Reason : Allow regular expressions from ignore list (-r)
|
#@ Reason : Allow regular expressions from ignore list (-r)
|
||||||
#@---------------------------------------------------
|
#@---------------------------------------------------
|
||||||
|
#@ Date : 20190701
|
||||||
|
#@ Author : Phil Randal (phil.randal@gmail.com)
|
||||||
|
#@ Reason : Fix lookup of warranty info for Dell (again)
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import sys
|
import sys
|
||||||
@@ -273,7 +276,7 @@ import re
|
|||||||
import pkg_resources
|
import pkg_resources
|
||||||
from optparse import OptionParser,OptionGroup
|
from optparse import OptionParser,OptionGroup
|
||||||
|
|
||||||
version = '20190510'
|
version = '20190701'
|
||||||
|
|
||||||
NS = 'root/cimv2'
|
NS = 'root/cimv2'
|
||||||
hosturl = ''
|
hosturl = ''
|
||||||
@@ -445,7 +448,7 @@ 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://www.dell.com/support/troubleshooting/' + dell_country(country) + '19/Product/poweredge-'
|
du = 'http://www.dell.com/support/home/' + dell_country(country) + '04/product-support/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) :
|
||||||
@@ -453,7 +456,7 @@ def urlised_server_info(vendor, country, server_info):
|
|||||||
if md == 'R210 II':
|
if md == 'R210 II':
|
||||||
md='r210-2'
|
md='r210-2'
|
||||||
md=md.lower()
|
md=md.lower()
|
||||||
server_info = p.group(1) + '<a href="' + du + md + '#ui-tabs-4">PowerEdge ' + p.group(2)+'</a> ' + p.group(3)
|
server_info = p.group(1) + '<a href="' + du + md + '/">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':
|
||||||
@@ -468,8 +471,8 @@ def urlised_server_info(vendor, country, server_info):
|
|||||||
def system_tag_url(vendor,country):
|
def system_tag_url(vendor,country):
|
||||||
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/home/'
|
||||||
dellsuffix = 'nodhs1/Index?t=warranty&servicetag='
|
dellsuffix = '19/product-support/servicetag/'
|
||||||
|
|
||||||
# warranty URLs for different country codes
|
# warranty URLs for different country codes
|
||||||
return supportsite + dell_country(country) + dellsuffix
|
return supportsite + dell_country(country) + dellsuffix
|
||||||
|
|||||||
Reference in New Issue
Block a user