Skip to main content
TomBruno
New Member
September 20, 2018
Solved

Export a filtered list from Device Inventory

  • September 20, 2018
  • 1 reply
  • 21108 views

Hi All

I have a filtered list of nearly 4000 devices in the Device Inventory of a 1500D FortiGate I support and wondered if there is a way to export the list

 

Thanks in advance

Best answer by Dave_Hall

Closest commands is the "diagnose user device <commands>" from the CLI

eg.

 

#diagnose user device <command> where command is... list                 List known hosts. get                  List a specific host. del                  Remove a specific host. clear                Clear discovered hosts. os-summary           Discovered OS summary. host-type-summary    Discovered host type summary. stats                User device stats. filter               Filter for various src-vis diagnostics. #diagnose user device filter <options> where options are: vd                 Index of virtual domain. os-name            Operating system name; "" matches unknown. type               Device type; "" matches unknown. list               Display the current filter. addr               IPv4 address range. type-src           Device type source. generation         Device generation. type-generation    Device type generation. joined             Device is joined to another. negate             Negate the specified filter parameter. clear              Clear the filter or parameter. Haven't played around with this diag commands, but I can assume you need to perform a console capture.

 

1 reply

Dave_Hall
Dave_HallAnswer
New Member
September 20, 2018

Closest commands is the "diagnose user device <commands>" from the CLI

eg.

 

#diagnose user device <command> where command is... list                 List known hosts. get                  List a specific host. del                  Remove a specific host. clear                Clear discovered hosts. os-summary           Discovered OS summary. host-type-summary    Discovered host type summary. stats                User device stats. filter               Filter for various src-vis diagnostics. #diagnose user device filter <options> where options are: vd                 Index of virtual domain. os-name            Operating system name; "" matches unknown. type               Device type; "" matches unknown. list               Display the current filter. addr               IPv4 address range. type-src           Device type source. generation         Device generation. type-generation    Device type generation. joined             Device is joined to another. negate             Negate the specified filter parameter. clear              Clear the filter or parameter. Haven't played around with this diag commands, but I can assume you need to perform a console capture.

 

sw2090
SuperUser
SuperUser
September 25, 2018

Or just create an (unencrypted) backup of your FGT via webinterface. This is then ust a textfile containing the whole config including your filtered device list.

lpopov
New Member
September 3, 2020

echo diag user dev list | ssh <user>@fg.ip.or.fqdn > usr.dev.lst

or in case there is vdoms :

(echo config vdom; echo edit VDOM_NAME; echo diag user dev list) | ssh <user>@fg.ip.or.fqdn > usr.dev.lst

 

or use sshpass to avoid interactively typing password