Skip to content

Commit

Permalink
Merge pull request #78 from radiorabe/quickfix/timedatectl
Browse files Browse the repository at this point in the history
[timedatectl] Fix typo in userparam
  • Loading branch information
hairmare authored Feb 10, 2019
2 parents 5b357ea + 9c44be1 commit 61099b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/timedatectl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ collection](https://github.com/radiorabe/rabe-zabbix).
### Macros
* `{$TIMEDATECTL_MAX_NO_SYNC_TIME}` (default: 60m)
### Triggers
* Warning: NTP not enabled
* Warning: NTP not enabled on {HOST.NAME}
```
{Template App timedatectl active:rabe.timedatectl.ntp.enabled.last()}=0
```
* Information: NTP not synchronized
* Information: NTP not synchronized on {HOST.NAME}
```
{Template App timedatectl active:rabe.timedatectl.ntp.synchronized.last()}=0
```
* Warning: NTP not synchronized for more than {$TIMEDATECTL_MAX_NO_SYNC_TIME}
* Warning: NTP not synchronized for more than {$TIMEDATECTL_MAX_NO_SYNC_TIME} on {HOST.NAME}
```
{Template App timedatectl active:rabe.timedatectl.ntp.synchronized.last(,{$TIMEDATECTL_MAX_NO_SYNC_TIME})}<1
```
Expand Down
4 changes: 2 additions & 2 deletions app/timedatectl/userparameters/timedatectl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#
# We support both the legacy (ie. CentOS 7) "NTP enabled" and the modern (ie. Fedora) "Network time on" string.
#
UserParameter=rabe.timedatectl.ntp.enabled,/bin/timedatectl --no-pager status | /bin/awk -F ': ' '/* ^[[:space:]]*(Network time on|NTP enabled):/ { if ($2 == "yes") { print 1; } else { print 0; } }'
UserParameter=rabe.timedatectl.ntp.enabled,/bin/timedatectl --no-pager status | /bin/awk -F ': ' '/^[[:space:]]*(Network time on|NTP enabled):/ { if ($2 == "yes") { print 1; } else { print 0; } }'

#
# "NTP synchonized" yes/no value from timedatectl output
#
UserParameter=rabe.timedatectl.ntp.synchronized,/bin/timedatectl --no-pager status | /bin/awk -F ': ' '/* ^[[:space:]]*NTP synchronized:/ { if ($2 == "yes") { print 1; } else { print 0; } }'
UserParameter=rabe.timedatectl.ntp.synchronized,/bin/timedatectl --no-pager status | /bin/awk -F ': ' '/^[[:space:]]*NTP synchronized:/ { if ($2 == "yes") { print 1; } else { print 0; } }'

0 comments on commit 61099b9

Please sign in to comment.