Explorar el Código

JUNOS plugins: Dump response if verbose >= 5.

Sebastian Harl hace 12 años
padre
commit
bc30719a44
Se han modificado 3 ficheros con 12 adiciones y 0 borrados
  1. 4 0
      check_junos_bgp.pl
  2. 4 0
      check_junos_vc.pl
  3. 4 0
      perl/lib/Nagios/Plugin/JUNOS.pm

+ 4 - 0
check_junos_bgp.pl

@@ -39,6 +39,8 @@ use warnings;
 
 use utf8;
 
+use Data::Dumper;
+
 use POSIX qw( :termios_h );
 use Nagios::Plugin;
 
@@ -284,6 +286,8 @@ sub send_query
 		$res = $device->$query();
 	}
 
+	verbose(5, "Got response: " . Dumper(\$res));
+
 	if (! ref $res) {
 		return "ERROR: Failed to execute query '$query'";
 	}

+ 4 - 0
check_junos_vc.pl

@@ -39,6 +39,8 @@ use warnings;
 
 use utf8;
 
+use Data::Dumper;
+
 use POSIX qw( :termios_h );
 use Nagios::Plugin;
 
@@ -501,6 +503,8 @@ sub send_query
 		$res = $device->$query();
 	}
 
+	verbose(5, "Got response: " . Dumper(\$res));
+
 	if (! ref $res) {
 		return "ERROR: Failed to execute query '$query'";
 	}

+ 4 - 0
perl/lib/Nagios/Plugin/JUNOS.pm

@@ -35,6 +35,8 @@ package Nagios::Plugin::JUNOS;
 
 use Carp;
 
+use Data::Dumper;
+
 use POSIX qw( :termios_h );
 
 use Nagios::Plugin;
@@ -438,6 +440,8 @@ sub send_query
 		}
 	}
 
+	$self->verbose(5, "Got response: " . Dumper(\$res));
+
 	if (! ref $res) {
 		return "ERROR: Failed to execute query '$query'";
 	}