add antivirus info

This commit is contained in:
wh1te909 2019-11-18 01:07:06 +00:00
parent e62f7e5821
commit 9881ff5445
3 changed files with 22 additions and 0 deletions

View File

@ -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),
),
]

View File

@ -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)

View File

@ -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)