Imported Upstream version 1.4.16
This commit is contained in:
		
							parent
							
								
									212b4b8677
								
							
						
					
					
						commit
						e76be63abf
					
				
					 50 changed files with 11903 additions and 38608 deletions
				
			
		| 
						 | 
				
			
			@ -188,6 +188,10 @@ SKIP: {
 | 
			
		|||
	is( $result->return_code, 1, "$command -p $port_https -S -C 14000" );
 | 
			
		||||
	like( $result->output, '/WARNING - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(03/03/2019 21:41\)./', "output ok" );
 | 
			
		||||
 | 
			
		||||
        $result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" );
 | 
			
		||||
        is( $result->return_code, 1, "$command -p $port_https -S -C 139600,14000" );
 | 
			
		||||
        like( $result->output, '/CRITICAL - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(03/03/2019 21:41\)./', "output ok" );
 | 
			
		||||
 | 
			
		||||
	# Expired cert tests
 | 
			
		||||
	$result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" );
 | 
			
		||||
	is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,7 +8,7 @@ use Test::More;
 | 
			
		|||
use NPTest;
 | 
			
		||||
use FindBin qw($Bin);
 | 
			
		||||
 | 
			
		||||
my $tests = 41;
 | 
			
		||||
my $tests = 53;
 | 
			
		||||
# Check that all dependent modules are available
 | 
			
		||||
eval {
 | 
			
		||||
	require NetSNMP::OID;
 | 
			
		||||
| 
						 | 
				
			
			@ -144,6 +144,31 @@ is($res->return_code, 0, "OK as no thresholds" );
 | 
			
		|||
is($res->output, "SNMP RATE OK - inoctets 333 | inoctets=333 ", "Check rate decreases due to longer interval");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# label performance data check
 | 
			
		||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 -l test" );
 | 
			
		||||
is($res->return_code, 0, "OK as no thresholds" );
 | 
			
		||||
is($res->output, "SNMP OK - test 67996 | test=67996c ", "Check label");
 | 
			
		||||
 | 
			
		||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 -l \"test'test\"" );
 | 
			
		||||
is($res->return_code, 0, "OK as no thresholds" );
 | 
			
		||||
is($res->output, "SNMP OK - test'test 68662 | \"test'test\"=68662c ", "Check label");
 | 
			
		||||
 | 
			
		||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 -l 'test\"test'" );
 | 
			
		||||
is($res->return_code, 0, "OK as no thresholds" );
 | 
			
		||||
is($res->output, "SNMP OK - test\"test 69328 | 'test\"test'=69328c ", "Check label");
 | 
			
		||||
 | 
			
		||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 -l test -O" );
 | 
			
		||||
is($res->return_code, 0, "OK as no thresholds" );
 | 
			
		||||
is($res->output, "SNMP OK - test 69994 | iso.3.6.1.4.1.8072.3.2.67.10=69994c ", "Check label");
 | 
			
		||||
 | 
			
		||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10" );
 | 
			
		||||
is($res->return_code, 0, "OK as no thresholds" );
 | 
			
		||||
is($res->output, "SNMP OK - 70660 | iso.3.6.1.4.1.8072.3.2.67.10=70660c ", "Check label");
 | 
			
		||||
 | 
			
		||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 -l 'test test'" );
 | 
			
		||||
is($res->return_code, 0, "OK as no thresholds" );
 | 
			
		||||
is($res->output, "SNMP OK - test test 71326 | 'test test'=71326c ", "Check label");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets_per_minute --rate-multiplier=60" );
 | 
			
		||||
is($res->return_code, 0, "OK for first call" );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue