Skip to content

Commit

Permalink
fix(about-me): expanded RAM isn't updating (closes #757)
Browse files Browse the repository at this point in the history
  • Loading branch information
markuslf committed Dec 9, 2024
1 parent 40848fa commit cc3c7d1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Icinga Director:

Monitoring Plugins:

* about-me: expanded RAM isn't updating ([#757](https://github.com/Linuxfabrik/monitoring-plugins/issues/757))
* apache-httpd.status: failure when mod_md is enabled ([#783](https://github.com/Linuxfabrik/monitoring-plugins/issues/783))
* docker-stats: ValueError: could not convert string to float: '0B' ([#776](https://github.com/Linuxfabrik/monitoring-plugins/issues/776))
* redfish-sel: UnboundLocalError: local variable 'sel_path' referenced before assignment ([#779](https://github.com/Linuxfabrik/monitoring-plugins/issues/779))
Expand Down
22 changes: 19 additions & 3 deletions check-plugins/about-me/about-me
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ except ImportError:


__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
__version__ = '2024112901'
__version__ = '2024120901'

DESCRIPTION = 'Provides a quick overview of host dimensions and software.'

Expand Down Expand Up @@ -798,7 +798,23 @@ def main():

dmi = lib.dmidecode.get_data()
sys_dimensions = get_sys_dimensions()
if dmi:
if dmi and sys_dimensions:
# combine the best from both worlds
msg += '{} {}, '.format(lib.dmidecode.manufacturer(dmi), lib.dmidecode.model(dmi))
msg += 'Firmware: {}, '.format(lib.dmidecode.firmware(dmi))
msg += 'SerNo: {}, '.format(lib.dmidecode.serno(dmi))
msg += 'Proc: {}, '.format(lib.dmidecode.cpu_type(dmi))
msg += '#Cores: {}, '.format(lib.dmidecode.cpu_cores_enabled(dmi))
msg += '#Threads: {}, '.format(lib.dmidecode.cpu_threads(dmi))
msg += 'Current Speed: {} MHz, '.format(lib.dmidecode.cpu_speed(dmi))
msg += '{}/{} RAM (virtmem/max'.format(
lib.human.bytes2human(sys_dimensions['ram']),
lib.human.bytes2human(lib.dmidecode.ram(dmi)),
)
if sys_dimensions['ram'] > lib.dmidecode.ram(dmi):
msg += '; reboot recommended'
msg += '), '
elif dmi:
msg += '{} {}, '.format(lib.dmidecode.manufacturer(dmi), lib.dmidecode.model(dmi))
msg += 'Firmware: {}, '.format(lib.dmidecode.firmware(dmi))
msg += 'SerNo: {}, '.format(lib.dmidecode.serno(dmi))
Expand All @@ -814,7 +830,7 @@ def main():
lib.human.bytes2human(sys_dimensions['ram'])
)
else:
msg += 'sys dimensions n/a (consider installing psutil), '
msg += 'sys dimensions n/a (consider installing dmidecode/psutil), '

disk_msg, disk_count = get_disks()
msg += disk_msg
Expand Down

0 comments on commit cc3c7d1

Please sign in to comment.