« lib/Monitoring/Generator/TestConfig.pm
↑ Summary
lib/Monitoring/Generator/TestConfig/Modules/Shinken.pm »
| 1 | package # hidden from cpan | ||||||||||
| 2 | Monitoring::Generator::TestConfig::ShinkenInitScriptData; | ||||||||||
| 3 | |||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | ######################################## | ||||||||||
| 8 | |||||||||||
| 9 | =over 4 | ||||||||||
| 10 | |||||||||||
| 11 | =item get_init_script | ||||||||||
| 12 | |||||||||||
| 13 | returns the init script source | ||||||||||
| 14 | |||||||||||
| 15 | adapted from the nagios debian package | ||||||||||
| 16 | |||||||||||
| 17 | =back | ||||||||||
| 18 | |||||||||||
| 19 | =cut | ||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub get_init_script { | ||||||||
|
Subroutine
get_init_script: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 22 | 0 | my $self = shift; | |||||||||
| 23 | 0 | my $prefix = shift; | |||||||||
| 24 | 0 | my $binary = shift; | |||||||||
| 25 | 0 | our $initsource; | |||||||||
| 26 | 0 | ▶ | if(!defined $initsource) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | $initsource = do { local $/; <DATA> }; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 0 | my $binpath = $binary; | |||||||||
| 31 | 0 | $binpath =~ s/^(.*)\/.*$/$1/mx; | |||||||||
| 32 | |||||||||||
| 33 | 0 | my $initscript = $initsource; | |||||||||
| 34 | 0 | $initscript =~ s/__PREFIX__/$prefix/gmx; | |||||||||
| 35 | 0 | $initscript =~ s/__BIN__/$binpath/gmx; | |||||||||
| 36 | 0 | return($initscript); | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 3 | 1; | |||||||||
| 40 | |||||||||||
| 41 | __DATA__ | ||||||||||