forked from ConSol-Monitoring/omd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
if multiple worker try to create the rrd folder at the same time, there will be an error.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- a/scripts/process_perfdata.pl.in 2023-02-28 15:22:09.112254795 +0100 | ||
+++ b/scripts/process_perfdata.pl.in 2023-02-28 15:25:47.864254899 +0100 | ||
@@ -28,6 +28,7 @@ | ||
use strict; | ||
use POSIX; | ||
use Getopt::Long; | ||
+use File::Path qw(make_path); | ||
use Time::HiRes qw(gettimeofday tv_interval); | ||
use vars qw ( $TEMPLATE %NAGIOS $t0 $t1 $rt $delayed_write $rrdfile @ds_create $count $line $name $ds_update $dstype %CTPL); | ||
|
||
@@ -429,20 +430,11 @@ | ||
$NAGIOS{MULTI_PARENT} = $data[0]{multi_parent} || ""; | ||
$TEMPLATE = $data[0]{template}; | ||
|
||
- unless ( -d "$conf{RRDPATH}" ) { | ||
- unless ( mkdir "$conf{RRDPATH}" ) { | ||
- print_log( "mkdir $conf{RRDPATH}, permission denied ", 1 ); | ||
- print_log( "PNP exiting ...", 1 ); | ||
- exit 5; | ||
- } | ||
- } | ||
- | ||
+ make_path($conf{RRDPATH}."/".$NAGIOS{HOSTNAME}); | ||
unless ( -d "$conf{RRDPATH}/$NAGIOS{HOSTNAME}" ) { | ||
- unless ( mkdir "$conf{RRDPATH}/$NAGIOS{HOSTNAME}" ) { | ||
- print_log( "mkdir $conf{RRDPATH}/$NAGIOS{HOSTNAME}, permission denied ", 1 ); | ||
- print_log( "PNP exiting ...", 1 ); | ||
- exit 6; | ||
- } | ||
+ print_log( "mkdir $conf{RRDPATH}/$NAGIOS{HOSTNAME}: ".$!, 1 ); | ||
+ print_log( "PNP exiting ...", 1 ); | ||
+ exit 6; | ||
} | ||
|
||
# |