2020-08-31 11:01:56 -04:00
|
|
|
|
|
|
|
.. blo1552681488499
|
|
|
|
.. _operator-command-logging:
|
|
|
|
|
2022-06-16 11:02:55 -03:00
|
|
|
==================================
|
|
|
|
StarlingX Operator Command Logging
|
|
|
|
==================================
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
|prod| logs all StarlingX REST API operator commands, except commands that use
|
|
|
|
only GET requests. |prod| also logs all |SNMP| commands, including ``GET``
|
|
|
|
requests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-------------------------------------------
|
|
|
|
StarlingX REST API Operator Command Logging
|
|
|
|
-------------------------------------------
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2023-02-28 14:02:05 +00:00
|
|
|
The logs include the timestamp, tenant name (if applicable), user name,
|
|
|
|
command executed, and command status (success or failure).
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
The files are located under the ``/var/log`` directory and are named using the
|
|
|
|
convention ``*api.log``. The list of log files is presented below.
|
|
|
|
|
|
|
|
|
|
|
|
- ``/var/log/sysinv-api.log``
|
|
|
|
|
|
|
|
- ``/var/log/fm-api.log``
|
|
|
|
|
|
|
|
- ``/var/log/dcmanager/dcmanager-api.log``
|
|
|
|
|
|
|
|
- ``/var/log/nfv-vim-api.log``
|
|
|
|
|
|
|
|
- ``/var/log/patching-api.log``
|
|
|
|
|
|
|
|
- ``/var/log/mtcAgent_api.log``
|
|
|
|
|
|
|
|
- ``/var/log/hwmond_api.log``
|
|
|
|
|
|
|
|
- ``/var/log/barbican/barbican-api.log``
|
|
|
|
|
|
|
|
.. only:: starlingx
|
|
|
|
|
|
|
|
You can examine the log files locally on the controllers.
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
.. only:: partner
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
.. include:: /_includes/operator-command-logging.rest
|
|
|
|
:start-after: begin-remote-log-server-options
|
|
|
|
:end-before: end-remote-log-server-options
|
2020-08-31 11:01:56 -04:00
|
|
|
|
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
For example, if the following command is issued:
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
``system modify --description="TEST01 DESCRIPTION"``
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
The following log is generated in ``/var/log/sysinv-api.log``:
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
``sysinv 2022-03-09 11:03:46.238 108478 INFO sysinv.api.hooks.auditor [req-be0eb23d-c815-4bb7-938a-bfb8adba496b 76752e1b78b54f7b8409e2c54a6b6082 1ba4a349b9f941e0a5bd658df4e4d4f7] 192.168.204.2 "PATCH /v1/isystems/7b64c984-8b6e-42da-88e5-d9ee17c5178e HTTP/1.0" status: 200 len: 1151 time: 0.0395379066467 POST: [{u'path': u'/description', u'value': u'TEST01 DESCRIPTION', u'op': u'replace'}] host:192.168.204.1:6385 agent:Python-httplib2/0.9.2 (gzip) user: admin tenant: admin domain: Default``
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
REST API request methods that will be logged include:
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
``PATCH``
|
|
|
|
The resource is being partially updated.
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
``POST``
|
|
|
|
The resource is being created or fully updated.
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
``DELETE``
|
|
|
|
The resource is being deleted.
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
``PUT``
|
|
|
|
Similar to ``POST`` with the difference that ``PUT`` requests are
|
|
|
|
idempotent, that is, multiple ``PUT`` calls produce the same result.
|
2020-08-31 11:01:56 -04:00
|
|
|
|
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
--------------------
|
|
|
|
SNMP Request Logging
|
|
|
|
--------------------
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
As the |SNMP| application is containerized, the logs of its commands are found
|
|
|
|
inside the container at file ``/var/log/snmpd.log``. Only basic information is
|
|
|
|
present in this log file, like command type, |SNMP| version and request status.
|
|
|
|
All |SNMP| requests are logged, including ``GET`` requests.
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
For example, if the following command is issued:
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
``SNMP GET OID .iso.3.6.1.2.1.1.1.0``
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
It will return the value:
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
``iso.3.6.1.2.1.1.1.0 = STRING: "22.02 5.10.74-200.1807.tis.el7.x86_64"``
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
And the following log is generated in ``/var/log/snmpd.log`` inside the |SNMP|
|
|
|
|
container:
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
.. code-block:: none
|
2020-08-31 11:01:56 -04:00
|
|
|
|
2022-04-25 15:05:14 -04:00
|
|
|
snmp-auditor transport:udp remote:10.20.3.3 reqid:1367258771 msg-type:GET version:v3
|
|
|
|
snmp-auditor reqid:1367258771 oid:SNMPv2-MIB::sysDescr.0
|
|
|
|
snmp-auditor reqid:1367258771 oid:SNMPv2-MIB::sysDescr.0 status:pass
|