fwebos_snmp_user_default.py – Config FortiWeb SNMP v3 user

New in version 1.0.1.

Synopsis

Config FortiWeb SNMP v3 user

Requirements

The below requirements are needed on the host that executes this module.

  • ansible>=2.11

FortiWeb Version Compatibility


v7.0.0 v7.0.1 v7.0.2 v7.0.3
fwebos_snmp_user_default.py yes

Parameters

  • body Possible parameters to go in the body for the request required: True
    • name unique snmp user name type:string maxLength:63
    • status set snmp user status type:string choice: enable, disable,
    • security-level set snmp user security level type:string choice: noauthnopriv, authnopriv, authpriv,
    • auth-proto set snmp user auth algorithm type:string choice: sha1, md5,
    • auth-pwd set snmp user auth password type:string format:password
    • priv-proto set snmp user private algorithm type:string choice: aes, des,
    • priv-pwd set snmp user private password type:string format:password
    • query-status set snmp query status type:string choice: enable, disable,
    • query-port set query port value of snmp type:integer
    • trap-status set snmp trap status type:string choice: enable, disable,
    • trapport-local set local trap port value of snmp type:integer
    • trapport-remote set remote trap port value of snmp type:integer
    • trapevent Trap event allowed to be sent type:string choice: cpu-high, mem-low, log-full, intf-ip, sys-mode-change, policy-start, policy-stop, pserver-failed, sys-ha-cluster-status-change, sys-ha-member-join, sys-ha-member-leave, waf-amethod-attack, waf-signature-detection, waf-url-access-attack, waf-pvalid-attack, waf-hidden-fields, netlink-up-status, netlink-down-status, power-supply-failure, policy-ldap-auth-failure, policy-radius-auth-failure,
    • hosts add/edit snmp user host entry type:array
      • id host entry id
      • ip Class A,B,C ip xxx.xxx.xxx.xxx or IPv6
    • mkey If present, objects will be filtered on property with this name type:string
    • vdom Specify the Virtual Domain(s) from which results are returned or changes are applied to. If this parameter is not provided, the management VDOM will be used. If the admin does not have access to the VDOM, a permission error will be returned. The URL parameter is one of: vdom=root (Single VDOM) vdom=vdom1,vdom2 (Multiple VDOMs) vdom=* (All VDOMs) type:array
    • clone_mkey Use *clone_mkey* to specify the ID for the new resource to be cloned. If *clone_mkey* is set, *mkey* must be provided which is cloned from. type:string

Examples

- name:
hosts: all
vars:
connection: httpapi
gather_facts: false
tasks:
  - name: Create snmp user
    fwebos_snmp_user:
     action: add
     name: 166
     security_level: authnopriv
     security_level_val: 1
     auth_proto: sha1
     auth_proto_val: 1
     auth_pwd: 111166666
     priv_proto: aes
     priv_proto_val: 1
     priv_pwd: ENC XXXX
     query_status: enable
     query_status_val: 1
     query_port: 199
     trap_status: enable
     trap_status_val: 1
     trapport_local: 162
     trapport_remote: 162
     sz_hosts: -1

  - name: edit snmp user
    fwebos_snmp_user:
     action: edit
     name: 166
     trapport_local: 168
     trapport_remote: 168
     trapevent: cpu-high mem-low
     trapevent_val: 0

  - name: delete snmp user
    fwebos_snmp_user:
     action: delete
     name: 166

Return Values

Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:

  • 200 : OK: Request returns successful
  • 400 : Bad Request: Request cannot be processed by the API
  • 401 : Not Authorized: Request without successful login session
  • 403 : Forbidden: Request is missing CSRF token or administrator is missing access profile permissions.
  • 404 : Resource Not Found: Unable to find the specified resource.
  • 405 : Method Not Allowed: Specified HTTP method is not allowed for this resource.
  • 413 : Request Entity Too Large: Request cannot be processed due to large entity
  • 424 : Failed Dependency: Fail dependency can be duplicate resource, missing required parameter, missing required attribute, invalid attribute value
  • 429 : Access temporarily blocked: Maximum failed authentications reached. The offended source is temporarily blocked for certain amount of time.
  • 500 : Internal Server Error: Internal error when processing the request

For errorcode please check FortiWeb API errorcode at : https://documenter.getpostman.com/view/11233300/TVetbkaK#887b9eb4-7c13-4338-a8db-16cc117f0119

Status

  • This module is not guaranteed to have a backwards compatible interface.

Authors

  • Link Zheng (@chillancezen)
  • Jie Xue (@JieX19)
  • Hongbin Lu (@fgtdev-hblu)
  • Frank Shen (@frankshen01)
  • Miguel Angel Munoz (@mamunozgonzalez)

Hint

If you notice any issues in this documentation, you can create a pull request to improve it.