feat(server): Update the time of last access for scan agent

!11 closes #5
This commit is contained in:
2024-02-24 22:00:46 +09:30
parent 181a3bdc44
commit 46f25ea616
2 changed files with 29 additions and 0 deletions

View File

@ -75,6 +75,17 @@ When this setting is enabled, the scanner will scan the entire subnet that has b
This is displayed within the subnet interface next to the `Discover new hosts` field. Whenever a scan report is received by the server this filed is updated to reflect the last scan time. This is displayed within the subnet interface next to the `Discover new hosts` field. Whenever a scan report is received by the server this filed is updated to reflect the last scan time.
### Scan Agent
- Location `Administration -> Scan agents [Last access]`
This is displayed within the Scan Agent table in column `Last access`. When ever the scanner checks in, the time of the checkin is used to update the field.
- Location `Subnet -> Scan agent [Last Check]`
This is displayed within the subnet interface next to `Scan agent` field. When ever the scanner checks in, the time of the checkin is used to update the field.
## Development Notes ## Development Notes
Contributions to this project are welcome. Below you will find some useful commands for use during development. Contributions to this project are welcome. Below you will find some useful commands for use during development.

View File

@ -38,6 +38,24 @@
register: mysql_query_agent_details register: mysql_query_agent_details
- name: Update Scan Agent Last seen
community.mysql.mysql_query:
login_host: "{{ nofusscomputing_phpipam_scan_server.mysql_host }}"
login_port: "{{ nofusscomputing_phpipam_scan_server.mysql_port | default(3306) | int }}"
login_user: "{{ nofusscomputing_phpipam_scan_server.mysql_user }}"
login_password: "{{ nofusscomputing_phpipam_scan_server.mysql_password }}"
login_db: 'phpipam'
query: |-
UPDATE
scanAgents
SET
last_access = '{{ ('%Y-%m-%d %H:%M:%S' | strftime) }}'
WHERE
id = '{{ mysql_query_agent_details.query_result[0][0].id }}'
single_transaction: true
- name: Confirm Subnet Assignment - name: Confirm Subnet Assignment
community.mysql.mysql_query: community.mysql.mysql_query:
login_host: "{{ nofusscomputing_phpipam_scan_server.mysql_host }}" login_host: "{{ nofusscomputing_phpipam_scan_server.mysql_host }}"