File tree 1 file changed +5
-0
lines changed
plugins/plugins-available/agents/lib/Thruk/Utils/CLI
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ Available commands are:
35
35
--ip set ip address (available in add mode)
36
36
--section set section (available in add mode)
37
37
-k | --insecure skip tls verification (available in add mode)
38
+ --cached use cached host inventory
38
39
39
40
40
41
=back
@@ -92,6 +93,7 @@ sub cmd {
92
93
' clear_manual' => undef ,
93
94
' section' => undef ,
94
95
' insecure' => undef ,
96
+ ' cached' => undef ,
95
97
};
96
98
$opt -> {' fresh' } = 1 if Thruk::Base::array_contains(' -II' , $commandoptions );
97
99
$opt -> {' clear_manual' } = 1 if Thruk::Base::array_contains(' -III' , $commandoptions );
@@ -116,6 +118,7 @@ sub cmd {
116
118
" ip=s" => \$opt -> {' address' },
117
119
" section=s" => \$opt -> {' section' },
118
120
" k|insecure" => \$opt -> {' insecure' },
121
+ " cached" => \$opt -> {' cached' },
119
122
) or do {
120
123
return (Thruk::Utils::CLI::get_submodule_help(__PACKAGE__ ));
121
124
};
@@ -672,6 +675,8 @@ sub _get_checks {
672
675
$port = $1 ;
673
676
}
674
677
678
+ $update = 0 if $opt -> {' cached' };
679
+
675
680
my $hosts = $c -> db-> get_hosts(filter => [ Thruk::Utils::Auth::get_auth_filter( $c , ' hosts' ),
676
681
' custom_variables' => { ' ~' => ' AGENT .+' },
677
682
' name' => $hostname ,
You can’t perform that action at this time.
0 commit comments