equal
deleted
inserted
replaced
41 DEPENDENT => 4 |
41 DEPENDENT => 4 |
42 ); |
42 ); |
43 |
43 |
44 my $ME = basename $0; |
44 my $ME = basename $0; |
45 my $NAME = "Z-PUSH"; |
45 my $NAME = "Z-PUSH"; |
46 my $VERSION = "0.1"; |
46 my $VERSION = "0.2"; |
47 |
47 |
48 my %opt = ( |
48 my %opt = ( |
49 url => "http://developer.berlios.de/project/showfiles.php?group_id=8963", |
49 url => "http://developer.berlios.de/project/showfiles.php?group_id=8963", |
50 file => "/var/www/z-push/version.php" |
50 file => "/var/www/z-push/version.php" |
51 ); |
51 ); |
88 |
88 |
89 open( FH, $file ) |
89 open( FH, $file ) |
90 or say "$NAME CRITICAL: $file - $!." and exit $ERRORS{CRITICAL}; |
90 or say "$NAME CRITICAL: $file - $!." and exit $ERRORS{CRITICAL}; |
91 |
91 |
92 while (<FH>) { |
92 while (<FH>) { |
93 /^\$zpush_version\s+=\s+"(?<version>[\d.]+)/ and return $+{version}; |
93 /^\$zpush_version\s+=\s+"(?<version>[\d.-]+)/ and return $+{version}; |
94 } |
94 } |
95 |
95 |
96 close(FH); |
96 close(FH); |
97 |
97 |
98 say "$NAME CRITICAL: Can't find installed version." |
98 say "$NAME CRITICAL: Can't find installed version." |
110 my $zpb = undef; |
110 my $zpb = undef; |
111 foreach (@webside) { |
111 foreach (@webside) { |
112 if ( $zpb || m|<h3>Z-Push Backend</h3>| ) { |
112 if ( $zpb || m|<h3>Z-Push Backend</h3>| ) { |
113 $zpb = 1; |
113 $zpb = 1; |
114 m|<h3>Z-Push Backend/older releases</h3>| and last; |
114 m|<h3>Z-Push Backend/older releases</h3>| and last; |
115 m|>Version\s+(?<version>[\d.]+)<| and return $+{version}; |
115 m|>z-push-(?<version>[\d.-]+).tar.gz<| and return $+{version}; |
116 } |
116 } |
117 } |
117 } |
118 |
118 |
119 say "$NAME CRITICAL: Can't find last version." and exit $ERRORS{CRITICAL}; |
119 say "$NAME CRITICAL: Can't find last version." and exit $ERRORS{CRITICAL}; |
120 } |
120 } |
180 |
180 |
181 This nagios plugin search on a specified I<url> for a new version of z-push and compare the search result with an installed version. |
181 This nagios plugin search on a specified I<url> for a new version of z-push and compare the search result with an installed version. |
182 |
182 |
183 =head1 VERSION |
183 =head1 VERSION |
184 |
184 |
185 This man page is current for version 0.1 of B<check_zpush>. |
185 This man page is current for version 0.2 of B<check_zpush>. |
186 |
186 |
187 =head1 AUTHOR |
187 =head1 AUTHOR |
188 |
188 |
189 Written by Christian Arnold L<arnold@schlittermann.de> |
189 Written by Christian Arnold L<arnold@schlittermann.de> |
190 |
190 |