Juno::Check::RawCommand - A raw command check for Juno
version 0.010
Allows you to run a raw command. The command will be run in a separate fork using System::Command so you can get full access to everything in the command (stdout, stderr, exit code, etc.).
The command to run. This allows a very simple template that allows you to use %h as the host.
%h
An arrayref of hosts to check, overriding the default given to Juno.pm.
my $juno = Juno->new( checks => { RawCommand => { hosts => ['Jeff'], cmd => 'grep %h %h.log', # %h will be the host on_success => sub { my ( $check, $host, $cmd ) = @_; print "Found $host in $host.log\n" . $cmd->{'stdout'}; }, on_fail => sub { my ( $check, $host, $cmd, $msg ) = @_; $msg and print "Deserialization failed, odd error: $msg\n"; print "Failed to find $host in log.txt:\n" . $cmd->{'stderr'}; }, }, }, );
This attribute derives from Juno::Role::Check.
An integer of seconds between each check (nor per-host).
A coderef to run when making a successful result, which is zero by default.
A coderef to run when making an unsuccessful request, which isn't zero by default.
A coderef to run on the result. This is what you use in case you want more control over what's going on.
A coderef to run before running the command.
Holds the watcher for the command check timer.
Juno will call this method for you. You should not call it yourself.
Sawyer X <xsawyerx@cpan.org>
Adam Balali <adamba@cpan.org>
This software is copyright (c) 2012 by Sawyer X.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Juno, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Juno
CPAN shell
perl -MCPAN -e shell install Juno
For more information on module installation, please visit the detailed CPAN module installation guide.