Forum Discussion
So I am not sure this is what you want, and it may scare the heck out of you as it did me, but you can do this via the API. Here is a segment of code we developed to deal with the fact that LM does not allow you to manually extend the IP list for a device (currently) and we were unable to get NetFlow data associated to higher end Palo Alto firewalls otherwise.
And, I warned you. This is scary. It is LESS scary now as when I first did it, the requirements were HTTP basic authentication, not an API keyset. As far as I recall, this one is a v2 API path. Code fragment is from a Perl script, but should be reasonably clear for alternate language development.
my $cmdline = "!hostproperty action=add host=$host property=ips value=@{[join(',', @iplist)]}";
my $content = to_json({"cmdline" => $cmdline});
verbose 1, "content = $content\n";
if ($dryrun){
print qq(post(path => "/debug", content => $content, _scope => "internal", collectorId => $collector)), "\n";
}
else {
my $response = $lmapi->post(path => "/debug", content => $content, _scope => "internal", collectorId => $collector);
warn "Response:\n" . Dumper($response) . "\n" if $debug;
}
Related Content
- 3 months ago
- 26 days ago
- 7 years ago
- 10 months ago