Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent pacemaker (e.g: 2.0.5) prefix lines with " * " #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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