Package Summary

Tags No category tags.
Version 4.0.6
License BSD-3-Clause
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ros/diagnostics.git
VCS Type git
VCS Version ros2-humble
Last Updated 2025-05-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

diagnostic_common_diagnostics

Additional Links

Maintainers

  • Austin Hendrix
  • Brice Rebsamen
  • Christian Henkel
  • Ralph Lange

Authors

  • Brice Rebsamen

General information about this repository, including legal information, build instructions and known issues/limitations, are given in README.md in the repository root.

The diagnostic_common_diagnostics package

This package provides generic nodes to monitor a Linux host.

Currently only the NTP monitor is ported to ROS2.

Nodes

cpu_monitor.py

The cpu_monitor module allows users to monitor the CPU usage of their system in real-time. It publishes the usage percentage in a diagnostic message.

  • Name of the node is “cpu_monitor_” + hostname.
  • Uses the following args:
    • warning_percentage: If the CPU usage is > warning_percentage, a WARN status will be publised.
    • window: the maximum length of the used collections.deque for queuing CPU readings.

Published Topics

/diagnostics

diagnostic_msgs/DiagnosticArray The diagnostics information.

Parameters

warning_percentage

(default: 90) warning percentage threshold.

window

(default: 1) Length of CPU readings queue.

ntp_monitor.py

Runs ‘ntpdate’ to check if the system clock is synchronized with the NTP server.

  • If the offset is smaller than offset-tolerance, an OK status will be published.
  • If the offset is larger than the configured offset-tolerance, a WARN status will be published,
  • if it is bigger than error-offset-tolerance, an ERROR status will be published.
  • If there was an error running ntpdate, an ERROR status will be published.

Published Topics

/diagnostics

diagnostic_msgs/DiagnosticArray The diagnostics information.

Parameters

ntp_hostname

(default: “pool.ntp.org”) Hostname of NTP server.

offset-tolerance”

(default: 500) Allowed offset from NTP host. Above this is a warning.

error-offset-tolerance

(default: 5000000) If the offset from the NTP host exceeds this value, it is reported as an error instead of warning.

self_offset-tolerance

(default: 500) Offset from self

diag-hostname

Computer name in diagnostics output (ex: ‘c1’)

no-self-test

(default: True) Disable self test.

hd_monitor.py

Runs ‘shutil.disk_usage’ to check if there is enough space left on a given device. With default parameters, the following thresholds are used:

  • Above 5% of free space left, an OK status will be published.
  • Between 5% and 1%, a WARN status will be published,
  • Below 1%, an ERROR status will be published.

Published Topics

/diagnostics

diagnostic_msgs/DiagnosticArray The diagnostics information.

Parameters

path

(default: home directory “~”) Path in which to check remaining space.

free_percent_low

(default: 5%) Warning threshold.

free_percent_crit

(default: 1%) Error threshold.

ram_monitor.py

The ram_monitor module allows users to monitor the RAM usage of their system in real-time. It publishes the usage percentage in a diagnostic message.

  • Name of the node is “ram_monitor_” + hostname.
  • Uses the following args:
    • warning_percentage: If the RAM usage is > warning_percentage, a WARN status will be published.
    • window: the maximum length of the used collections.deque for queuing RAM readings.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package diagnostic_common_diagnostics

4.0.6 (2025-05-26)

  • C++17 and cmake 3.20 everywhere (#510)
  • Contributors: Christian Henkel

4.0.4 (2025-05-12)

4.0.2 (2025-02-10)

  • common_diagnostics cleaned hostname string (#405) (#419)

    * Hostnames are properly cleaned to only contain alphanumeric characters or underscore. Co-authored-by: sjusner <<simon.jusner@knapp.com>>

  • Add missing rclpy dependency to common_diagnostics to fix rosdoc2 output (#402) (#406) Co-authored-by: R Kent James <<kent@caspia.com>>

  • [ros2-humble] Port hd_monitor to ROS2 (#334) (#381)

    * Port hd_monitor to ROS2 (#334) Co-authored-by: Antoine Lima <<7421319+limaanto@users.noreply.github.com>>

  • Contributors: Christian Henkel

3.2.1 (2024-06-27)

  • refactor(sensors_monitor): ros2 port #339 (#365)
  • refactor(ram_monitor): ros2 port (#338)
  • NTP monitor improvements (#342) (#350)
  • Using ubuntu ntp server in systemtest (#346) (#347)
  • Fixing ntp launchtest (#330)
  • Contributors: Christian Henkel, Rein Appeldoorn

3.2.0 (2024-03-22)

  • Port cpu_monitor to ROS2 (#326)
  • Debugging instability introduced by #317 (#323)
  • not testing on foxy any more (#310)
  • Iron support (#304)
  • Contributors: Christian Henkel, Richard

3.1.2 (2023-03-24)

  • replacing ntpdate with ntplib (#289)
  • Contributors: Christian Henkel

3.1.1 (2023-03-16)

  • Secretly supporting galactic (#295)
  • Linting additional package (#268)
  • Maintainer update
  • Contributors: Austin, Christian Henkel, Ralph Lange

3.1.0 (2023-01-26)

  • Adding READMEs to the repo (#270)
  • License fixes (#263)
  • Fix/cleanup ros1 (#257)
  • Port ntp_monitor to ROS2 (#242)
  • Contributors: Austin, Christian Henkel, RFRIEDM-Trimble, Ralph Lange

1.9.3 (2018-05-02)

1.9.2 (2017-07-15)

  • FIX: add missing dependency
  • Contributors: trainman419

1.9.1 (2017-07-15)

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged diagnostic_common_diagnostics at Robotics Stack Exchange