Fujitsu INTEGRATED REMOTE MANAGEMENT CONTROLLER IRMC S2/S3 Manuel d'utilisateur Page 423

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 426
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 422
iRMC S2/S3 423
Configuring the iRMC S2/S3 via SCCI and scripted configuration
12.2.2.4 Scripting with Python
#!/usr/bin/python3
import sys
import httplib2
from urllib.parse import urlencode
# ==============================================================
# iRMC
USER = 'admin'
PWD = 'admin'
IP_ADDR = '192.168.1.100'
# ==============================================================
h = httplib2.Http()
# Basic/Digest authentication
h.add_credentials(USER, PWD)
def doit(data,ausgabe=sys.stdout):
try:
resp, content = h.request("http://%s/config" % IP_ADDR,
"POST", data)
if resp['status'] == '200'
data = content.decode('utf-8')
print(data,file=ausgabe)
else:
print('STATUS:',resp['status'],file=ausgabe)
print(str(resp),file=ausgabe)
except Exception as err:
print('ERROR:',str(err),file=ausgabe)
print()
# Example 1 - send a configuration file to the iRMC S2/S3
try:
data = open('ConfigFile.pre').read()
doit(data)
except Exception as err:
print('ERROR:',str(err),file=ausgabe)
# Example 2 - Set Config Space Values
# 0x200 (ConfCabinetLocation) and
# 0x204 (ConfSystemContact) direct from the script
#
LocationContact = '''<?xml version="1.0" encoding="UTF-8"
standalone="yes" ?>
Vue de la page 422
1 2 ... 418 419 420 421 422 423 424 425 426

Commentaires sur ces manuels

Pas de commentaire