fortinet-ansible-dev / ansible-galaxy-fortios-collection

GNU General Public License v3.0
84 stars 48 forks source link

fortios_system_admin: gui-dashboard widget fortiview attribute unknown #210

Closed BosMutus closed 3 weeks ago

BosMutus commented 1 year ago

Hi All,

There is a problem when using the gui dashboard widgets with the type "fortiview". They require additional attributes like fortiview_type, fortiview_sort_by, fortiview_timeframe, fortiview_visualization. When using them, a HTTPS Post error 500 occur with the notification, that the attribute "fortiview-type" must be set. When using the parameters with dashes, ansible complains about unknown parameters.

When using the attributes with dashes in the fortios_json_generic, the Dashboard can be built correctly,

Currently used versions: Ansible: 2.13.6 FortiOs Collection: 2.2.0

widget:
            -
              id: "1"
              type: "fortiview"
              width: "2"
              height: "1"
              x_pos: "1"
              fortiview_type: "compromisedHosts"         #Device HTTPS POST 500 error reply from device: fortiview-type is not set
              fortiview_sort_by: "verdict"                         #expecting similar but not provable as it complains intially about fortiview_type
              fortiview_timeframe: "hour"                       #expecting similar but not provable as it complains intially about fortiview_type
              fortiview_visualization: "table"`                  #expecting similar but not provable as it complains intially about fortiview_type
widget:
            -
              id: "1"
              type: "fortiview"
              width: "2"
              height: "1"
              x_pos: "1"
              fortiview-type: "compromisedHosts"       #Ansible Complains about unsupported parameters
              fortiview-sort_by: "verdict"                       #Ansible Complains about unsupported parameters
              fortiview-timeframe: "hour"                      
              fortiview-visualization: "table"

Thanks for assistance

MaxxLiu22 commented 1 year ago

Hi @BosMutus ,

Thanks for raising this issue, May I know which FOS version you are using? since many latest versions don't support "gui_dashboard" argument.

Thanks, Maxx

BosMutus commented 1 year ago

Hi @MaxxLiu22

Used FortiOS:

Tested Platforms, all the same issue: FWF61F FGT81E FGT201F

MaxxLiu22 commented 1 year ago

Hi @BosMutus ,

Thank you for your information. May I get a more detailed error message by adding -vvv at the end of command such as ansible-playbook -i hosts fortios_system_admin.yml -vvv. Since from my side, the most recent FOS version supporting "gui_dashboard" is 6.2.3, so I get a different error when running the script you provided on 6.4.10.

Thanks, Maxx