Comments (5)
Good 'ol iso8859 :D
I'll send you a patch to try tomorrow
from hwraid.
It seems your megacli outputs some characters in a non-utf8 charset, that's very weird.
Can you send the output to a file and run "file" on it to see what charset it detects ?
from hwraid.
/usr/sbin/megacli -LDInfo -l0 -a0 -NoLog > /tmp/mega
❯ file -0 /tmp/mega
/tmp/mega: ISO-8859 text, with CR, LF line terminators
on another working Server:
file -0 /tmp/mega
/tmp/mega: ASCII text, with CR, LF line terminators
from hwraid.
why is the output iso8859? all locale Settings between the Servers are the same and UTF-8 are default. Can / must i change something?
from hwraid.
We are running a bunch of old PERC 5/i adapters, for which MegaCLI 8.07.14 gives non-UTF8 and non-ASCII output (classified as "data" by the file command). I ended up using the patch below to get megaclisas-status to work with Python 3.9 on bullseye. It replaces popen
with subprocess.Popen
to be able to ignore the conversion errors ...
diff a/wrapper-scripts/megaclisas-status b/wrapper-scripts/megaclisas-status
--- a/wrapper-scripts/megaclisas-status
+++ b/wrapper-scripts/megaclisas-status
@@ -11,6 +11,7 @@ import sys
import pdb
import inspect
import argparse
+from subprocess import Popen, PIPE, STDOUT
if sys.platform == "win32":
import ctypes
@@ -144,8 +145,10 @@ def getOutput(cmd):
lines = Outputs[cmd]
else:
dbgprint("Not a Cached value: " + str(cmd))
- output = os.popen(cmd)
- for line in output:
+ process = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT, text=True, errors='ignore')
+ process.wait()
+ output = process.stdout.read()
+ for line in output.split("\n"):
if not re.match(r"^$", line.strip()):
lines.append(line.strip())
Outputs[cmd] = lines
from hwraid.
Related Issues (20)
- Repository for Debian bullseye HOT 10
- Debian package versions: stretch beats buster HOT 3
- https://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key expired HOT 4
- Missing packages - Debian 11 (bullseye) HOT 8
- LSI/Dell PERC H750 compatibility HOT 2
- LSI 3916 megaraid_sas problem HOT 2
- megaclisas-status difficulty processing megacli output HOT 1
- Ubuntu 22.04 Support
- Apt Warns HOT 1
- megacli and megaclisas-status kill conttroller's FW HOT 16
- Error opening terminal: xterm?
- Repository for Debian Bookworm HOT 12
- slight mishap
- H700 bricked (Dell T710) HOT 1
- Missing packages - Debian 12 (bookworm) HOT 10
- Debian bullseye, repository is now missing HOT 4
- megagli not working completely on debian 12 (Segmentation fault)
- hpacucli is not available for bullseye but the package from buster works
- SyntaxWarning: invalid escape sequence '\(' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hwraid.