Add PTP monitoring to collectd

This update adds Precision Time Protocol (PTP) monitoring
to the current list of inhouse developed collectd plugins.

Refer to the ptp.py header for a description of the monitoring
service algorithm and inline comments for detailed behavior.

Test Plan: see depends update commit message

Depends-On: https://review.openstack.org/#/c/647524
Change-Id: I46ebcb91e80a617853c298a03b1f733e0c33afb8
Story: 2002823
Task: 29492
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
This commit is contained in:
Eric MacDonald
2019-03-25 12:16:15 -04:00
parent 3df7c08c4e
commit 7d6a2c92c4
3 changed files with 6 additions and 37 deletions

View File

@@ -26,12 +26,6 @@ class platform::ptp (
$slave_only = true
}
if $enabled {
$pmon_ensure = 'link'
} else {
$pmon_ensure = 'absent'
}
file { 'ptp4l_config':
ensure => file,
path => '/etc/ptp4l.conf',
@@ -62,34 +56,6 @@ class platform::ptp (
mode => '0644',
content => template('platform/phc2sys.erb'),
}
-> file { 'ptp4l_pmon':
ensure => file,
path => '/etc/ptp4l.pmon.conf',
mode => '0644',
content => template('platform/ptp4l.pmon.conf.erb'),
}
-> file { 'phc2sys_pmon':
ensure => file,
path => '/etc/phc2sys.pmon.conf',
mode => '0644',
content => template('platform/phc2sys.pmon.conf.erb'),
}
-> file { 'ptp4l_pmon_link':
ensure => $pmon_ensure,
path => '/etc/pmon.d/ptp4l.conf',
target => '/etc/ptp4l.pmon.conf',
owner => 'root',
group => 'root',
mode => '0600',
}
-> file { 'phc2sys_pmon_link':
ensure => $pmon_ensure,
path => '/etc/pmon.d/phc2sys.conf',
target => '/etc/phc2sys.pmon.conf',
owner => 'root',
group => 'root',
mode => '0600',
}
-> exec { 'systemctl-daemon-reload':
command => '/usr/bin/systemctl daemon-reload',
}

View File

@@ -1,13 +1,14 @@
[Unit]
Description=Synchronize system clock or PTP hardware clock (PHC)
After=ntpdate.service
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/phc2sys
ExecStart=/usr/sbin/phc2sys $OPTIONS
ExecStart=-/usr/sbin/phc2sys $OPTIONS
ExecStartPost=/bin/bash -c 'echo $MAINPID > /var/run/phc2sys.pid'
ExecStopPost=/bin/rm -f /var/run/phc2sys.pid
Restart=on-failure
RestartPreventExitStatus=SIGTERM SIGINT SIGKILL SIGABRT 255
[Install]
WantedBy=multi-user.target

View File

@@ -4,9 +4,11 @@ Description=Precision Time Protocol (PTP) service
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/ptp4l
ExecStart=/usr/sbin/ptp4l $OPTIONS
ExecStart=-/usr/sbin/ptp4l $OPTIONS
ExecStartPost=/bin/bash -c 'echo $MAINPID > /var/run/ptp4l.pid'
ExecStopPost=/bin/rm -f /var/run/ptp4l.pid
Restart=on-failure
RestartPreventExitStatus=SIGTERM SIGINT SIGKILL SIGABRT 255
[Install]
WantedBy=multi-user.target