Description |
This article describes how to update device geo coordinated under the FortiAnalyzer manager by using the Tcl script in FortiManager. FortiAnalyzer does not automatically configure geo coordinates under dvm and it is necessary to configure manually under device manager or configure values for gui-device-latitude and gui-device-longitude parameters under FortiGate global config. FortiAnalyzer will automatically learn these coordinated through oftpd. |
Scope | FortiAnalyzer, FortiManager. |
Solution |
#! proc get_geo_coord gcoord { upvar $gcoord a set input [exec " dia sys waninf\n" "# " 15 ] set linelist [split $input \n] foreach line $linelist { if {![regexp {([^:]+):(.*)} $line dummy key value]} continue switch -regexp -- $key { Latitude { set a(latitude) [string trim $value] } Longitude { set a(longitude) [string trim $value] }} } } get_geo_coord coord proc do_upd {cmd} { puts [exec "$cmd\n" "# " 15] } do_upd "config system global" do_upd "set gui-device-latitude $coord(latitude)" do_upd "set gui-device-longitude $coord(longitude)" do_upd "end"
In the first part of script, geo coordinates are fetched from the device and configured under device settings
After script execution gui-device-latitude and gui-device-longitude parameter values are updated successfully.
After parameters configurations, FortiAnalyzer will learn through oftpd and update geographic coordinates under the device manager.
Note: Make sure the correct admin user and password are configured for the device under the FortiManager device manager. Otherwise, the Tcl script will not run.
Related documents: Technical Tip: How to troubleshoot TCL Scripts failed in FortiManager |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.