Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion check_crm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# check_crm_v0_8
# check_crm_v0_9
#
# Copyright © 2013 Philip Garner, Sysnix Consultants Limited
#
Expand All @@ -20,6 +20,8 @@
# threshold ( Zoran Bosnjak & Marko Hrastovec )
# v0.8 01/09/2020 - Make less assumptions about crm output
# ( Jan Tlusty )
# v0.9 25/03/2021 - Handle recent pacemaker prefixing lines with " * "
# ( Adam Cecile )
#
# NOTES: Requires Perl 5.8 or higher & the Perl Module Nagios::Plugin

Expand Down Expand Up @@ -109,6 +111,11 @@ sub gather_crm_output {

@crm_output = <$filehandle>;

# Recent pacemaker version (e.g: 2.0.5) prefix lines with " * " which breaks parsing
foreach (@crm_output) {
s/^\s+\*\s+//g;
}

close($filehandle) or $np->nagios_exit( CRITICAL, $errormessage );
}

Expand Down