Nagios Exchange Nagios Exchange
  • Home
  • Directory
  • Library
  • Support
  • About

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up
  • Home
  • Directory
  • Library
  • Support
  • About
Plugins4391Themes and Skins11Add-ons738Documentation283Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
Java Applications and Servers Cassandra unreachable nodes
0.0 (0)
82.2K
RSS Feed
Newest Listings Updated Listings
Top Contributors
Julien DESMAREST (6)LAMY (6)Davide Lemma (4)deskwork_itunes142 (4)Joerg Hoerter (3)
See More
Newest Contributors
messefreeze (2)apham (1)mngvn (2)Georg2Korger2 (1)Guillaume8723 (1)
See More

Copyright © 2009-2025 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home > Eduardo Kellenberger
EK

Eduardo Kellenberger

@eduardo.kellenberger

User Stats

Member Since: May 19, 2023

Favorites0

Views0

Projects1

Robocopy logfile check espanol
Others
Robocopy logfile check espanol
Checks the state of a regular robocopy copy job by scanning the logfile in spanish Usage: check_robocopy.pl [--user ] [--password ] [--maxAge ] where Is…
0.0 (0)
2K
0
Eduardo Kellenberger
MIT
Robocopy logfile check

this es for espanish

#!/usr/bin/perl # # check_robocopy.pl # - A nagios plugin to monitor a regular robocopy backup job. # # Usage: # check_robocopy.pl [--user ] [--password ] [--maxAge ] # # where # Is the path of a robocopy logfile, which might be local or provided as a smb: URI # ( e.g. smb://server/path/to/robocopy/logfile ) # --maxAge Check for a completed run in the last hours (default: 24 hours). # --user The username, if fetching logfile via smb # --password The password, if fetching logfile via smb # # Returns # CRITICAL if no copy job was finished in the given timespan, # WARNING if there were files/dirs which could not be copied and # OK otherwise. # # Also provides performance data. # # Author: Moritz Bechler for Schmieder IT Solutions (http://www.schmieder.de) # License: MIT License # # Copyright (c) 2010 Moritz Bechler # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # use strict; use FindBin; use lib "$FindBin::Bin"; use File::Temp; use Getopt::Long; use Date::Parse; use Date::Format; use DateTime::Format::Strptime; my $user = ''; my $password = ''; my $maxAge = 24; GetOptions('user=s' => $user, 'password=s' => $password, 'maxAge=n' => $maxAge); my $uri = shift; if(!$uri) { print "Usage: $0 [--user ] [--password ] [--maxAge ] smb://server/path/to/robocopy/logfilen"; die "No logfile URI provided"; } my $tmpfile = ''; if(! -e $uri) { $tmpfile = tmpnam(); my $cmd = "/usr/bin/smbget -q -n -o $tmpfile "; if($user) { $cmd .= "-U $user"; } if($password) { $cmd .= "%$password "; } $cmd .= "$uri"; my $returnCode = system($cmd); if ( $returnCode != 0 ) { print "CRITICAL: Failed to fetch robocopy logfilen"; exit(2); } } else { $tmpfile = $uri; } sub strtonum { my $str = shift; chomp $str; my $numpart = $str*1; my $offset = 1; if(substr($str,-1) == 'g') { $offset = 1024*1024*1024; } elsif (substr($str,-1) == 'm') { $offset = 1024*1024; } elsif (substr($str,-1) == 'k') { $offset = 1024; } return int($numpart * $offset); } my $started = 0; my $ended = 0; my $filesTotal = 0; my $filesCopied = 0; my $filesSkipped = 0; my $filesMismatch = 0; my $filesFailed = 0; my $filesExtra = 0; my $dirsTotal = 0; my $dirsCopied = 0; my $dirsSkipped = 0; my $dirsMismatch = 0; my $dirsFailed = 0; my $dirsExtra = 0; my $bytesTotal = 0; my $bytesCopied = 0; my $bytesPerSec = 0; my $totalTime = 0; open TMPFILE, " '%A, %d de %B de %Y %H:%M:%S', locale => 'es_ES', ); my $dt_original = $parser->parse_datetime($fecha_original); $dt_original->set_locale('en_US'); $dt_original->strftime('%a %b %d %I:%M:%S %Y'); }eg; open $fh, '>', $tmpfile or die "No se puede abrir el archivo para escritura: $!"; print $fh $content; close $fh; while(my $line = ) { if($line =~ m/s*Started : (.*)$/) { $started = str2time( $1 ); if(!$started) { print "UNKNOWN: Failed to parse daten"; exit 3; } } if($line =~ m/s*Ended : (.*)$/) { $ended = str2time( $1 ); if($ended 0 or $dirsFailed > 0) { print "WARNING: Some files failed to be backed-up"; $status = 1; } else { print "OK: Backup of $filesTotal files and $dirsTotal dirs finished in $totalTime on " . time2str("%c", $ended) . ""; } print " | filesTotal=$filesTotal,dirsTotal=$dirsTotal,filesCopied=$filesCopied,dirsCopied=$dirsCopied,"; print "filesSkipped=$filesSkipped,dirsSkipped=$dirsSkipped,filesFailed=$filesFailed,dirsFailed=$dirsFailed,"; print "bytesPerSec=$bytesPerSec,bytesTotal=$bytesTotal,bytesCopied=$bytesCopied"; print "n"; exit $status;

Reviewed 2 years ago

No Favorites Found

Copyright © 2009-2025 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home Browse Submit Profile