add antivirus info
This commit is contained in:
parent
e62f7e5821
commit
9881ff5445
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.7 on 2019-11-18 00:24
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('agents', '0008_agent_version'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='agent',
|
||||
name='antivirus',
|
||||
field=models.CharField(default='n/a', max_length=255),
|
||||
),
|
||||
]
|
|
@ -31,6 +31,7 @@ class Agent(models.Model):
|
|||
logged_in_username = models.CharField(null=True, max_length=200)
|
||||
cpu_info = JSONField(null=True)
|
||||
client = models.CharField(max_length=200)
|
||||
antivirus = models.CharField(default="n/a", max_length=255)
|
||||
site = models.CharField(max_length=150)
|
||||
monitoring_type = models.CharField(max_length=30)
|
||||
description = models.CharField(null=True, max_length=255)
|
||||
|
|
|
@ -276,6 +276,7 @@ def update(request):
|
|||
plat = data["platform"]
|
||||
plat_release = data["platform_release"]
|
||||
version = data["version"]
|
||||
av = data["av"]
|
||||
|
||||
agent = get_object_or_404(Agent, agent_id=agent_id)
|
||||
|
||||
|
@ -286,6 +287,7 @@ def update(request):
|
|||
agent.plat = plat
|
||||
agent.plat_release = plat_release
|
||||
agent.version = version
|
||||
agent.antivirus = av
|
||||
|
||||
agent.save(update_fields=[
|
||||
"last_seen",
|
||||
|
@ -296,6 +298,7 @@ def update(request):
|
|||
"plat",
|
||||
"plat_release",
|
||||
"version",
|
||||
"antivirus",
|
||||
])
|
||||
|
||||
sync_salt_modules_task.delay(agent.pk)
|
||||
|
|
Loading…
Reference in New Issue