-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added ipmi lan info section to 45Drives-system module
- Loading branch information
1 parent
b326c17
commit 60277f2
Showing
8 changed files
with
143 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## cockpit-45drives-hardware 2.0.1-4 | ||
## cockpit-45drives-hardware 2.0.1-5 | ||
|
||
* updated unsupported motherboard message in 45Drives-motherboard module | ||
* added ipmi lan info section to 45Drives-system module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"title": "cockpit-45drives-hardware", | ||
"prerelease": false, | ||
"version": "2.0.1", | ||
"buildVersion": "4", | ||
"buildVersion": "5", | ||
"author": "Mark Hooper <[email protected]>", | ||
"url": "https://github.com/45Drives/cockpit-hardware", | ||
"category": "utils", | ||
|
@@ -63,7 +63,7 @@ | |
"changelog": { | ||
"urgency": "medium", | ||
"version": "2.0.1", | ||
"buildVersion": "4", | ||
"buildVersion": "5", | ||
"ignore": [], | ||
"date": null, | ||
"packager": "Mark Hooper <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,8 @@ make DESTDIR=%{buildroot} install | |
/usr/share/cockpit/45drives-system/* | ||
|
||
%changelog | ||
* Mon Aug 23 2021 Mark Hooper <[email protected]> 2.0.1-5 | ||
- added ipmi lan info section to 45Drives-system module | ||
* Mon Aug 23 2021 Mark Hooper <[email protected]> 2.0.1-4 | ||
- updated unsupported motherboard message in 45Drives-motherboard module | ||
* Mon Aug 23 2021 Mark Hooper <[email protected]> 2.0.1-3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,8 @@ make DESTDIR=%{buildroot} install | |
/usr/share/cockpit/45drives-system/* | ||
|
||
%changelog | ||
* Mon Aug 23 2021 Mark Hooper <[email protected]> 2.0.1-5 | ||
- added ipmi lan info section to 45Drives-system module | ||
* Mon Aug 23 2021 Mark Hooper <[email protected]> 2.0.1-4 | ||
- updated unsupported motherboard message in 45Drives-motherboard module | ||
* Mon Aug 23 2021 Mark Hooper <[email protected]> 2.0.1-3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
cockpit-45drives-hardware (2.0.1-5focal) focal; urgency=medium | ||
|
||
* added ipmi lan info section to 45Drives-system module | ||
|
||
-- Mark Hooper <[email protected]> Mon, 23 Aug 2021 14:18:53 -0300 | ||
|
||
cockpit-45drives-hardware (2.0.1-4focal) focal; urgency=medium | ||
|
||
* updated unsupported motherboard message in 45Drives-motherboard module | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/fakeroot/usr/share/cockpit/45drives-system/helper_scripts/ipmi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python3 | ||
################################################################################ | ||
# ram: | ||
# used to return information about the ram configuration in a .json | ||
# format. This is a helper sctipt for use with the | ||
# cockpit-hardware package (https://github.com/45Drives/cockpit-hardware) | ||
# | ||
# Copyright (C) 2020, Mark Hooper <[email protected]> | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
################################################################################ | ||
import subprocess | ||
import re | ||
import json | ||
|
||
|
||
def ipmi_lan(): | ||
try: | ||
ipmi_lan_result = subprocess.Popen( | ||
["ipmitool","lan","print","1"],stdout=subprocess.PIPE,stderr=subprocess.PIPE,universal_newlines=True).stdout | ||
except: | ||
return None | ||
|
||
ipmi_lan_dict = { | ||
"IP Address": "-", | ||
"Subnet Mask": "-", | ||
"MAC Address": "-", | ||
"Default Gateway IP": "-" | ||
} | ||
|
||
for line in ipmi_lan_result: | ||
for field in ipmi_lan_dict.keys(): | ||
regex = re.search("^({fld})\s+:\s+(\S+)".format(fld=field),line) | ||
if regex != None: | ||
ipmi_lan_dict[regex.group(1)] = regex.group(2) | ||
return ipmi_lan_dict | ||
|
||
def main(): | ||
ipmi_lan_dict = ipmi_lan() | ||
print(json.dumps(ipmi_lan_dict,indent = 4)) | ||
|
||
if __name__ == "__main__": | ||
main() |