update demo

This commit is contained in:
wh1te909
2022-10-20 19:03:37 +00:00
parent 5ccf408fd6
commit b2bc3adb3d
2 changed files with 70 additions and 6 deletions

View File

@@ -27,6 +27,7 @@ from tacticalrmm.constants import (
EvtLogFailWhen,
EvtLogNames,
EvtLogTypes,
GoArch,
PAAction,
ScriptShell,
TaskSyncStatus,
@@ -47,10 +48,12 @@ from tacticalrmm.demo_data import (
temp_dir_stdout,
wmi_deb,
wmi_pi,
wmi_mac,
disks_mac,
)
from winupdate.models import WinUpdate, WinUpdatePolicy
AGENTS_TO_GENERATE = 20
AGENTS_TO_GENERATE = 100
SVCS = settings.BASE_DIR.joinpath("tacticalrmm/test_data/winsvcs.json")
WMI_1 = settings.BASE_DIR.joinpath("tacticalrmm/test_data/wmi1.json")
@@ -169,7 +172,7 @@ class Command(BaseCommand):
for site in sites6:
Site(client=client6, name=site).save()
hostnames = (
win_hostnames = (
"DC-1",
"DC-2",
"FSV-1",
@@ -194,6 +197,7 @@ class Command(BaseCommand):
linux_deb_os = "Debian 11.2 x86_64 5.10.0-11-amd64"
linux_pi_os = "Raspbian 11.2 armv7l 5.10.92-v7+"
mac_os = "Darwin 12.5.1 arm64 21.6.0"
public_ips = ("65.234.22.4", "74.123.43.5", "44.21.134.45")
@@ -311,20 +315,30 @@ class Command(BaseCommand):
if plat_pick in (7, 11):
agent.plat = AgentPlat.LINUX
mode = AgentMonType.SERVER
agent.hostname = "db-aws-01"
# pi arm
if plat_pick == 7:
agent.goarch = "arm"
agent.goarch = GoArch.ARM32
agent.wmi_detail = wmi_pi
agent.disks = disks_linux_pi
agent.operating_system = linux_pi_os
else:
agent.goarch = "amd64"
agent.goarch = GoArch.AMD64
agent.wmi_detail = wmi_deb
agent.disks = disks_linux_deb
agent.operating_system = linux_deb_os
elif plat_pick in (4, 14):
agent.plat = AgentPlat.DARWIN
agent.hostname = "Karens-MacBook-Air.local"
mode = random.choice([AgentMonType.SERVER, AgentMonType.WORKSTATION])
agent.goarch = GoArch.ARM64
agent.wmi_detail = wmi_mac
agent.disks = disks_mac
agent.operating_system = mac_os
else:
agent.plat = AgentPlat.WINDOWS
agent.goarch = "amd64"
agent.hostname = random.choice(win_hostnames)
agent.goarch = GoArch.AMD64
mode = random.choice(modes)
agent.wmi_detail = random.choice(wmi_details)
agent.services = services
@@ -334,7 +348,6 @@ class Command(BaseCommand):
else:
agent.operating_system = random.choice(op_systems_workstations)
agent.hostname = random.choice(hostnames)
agent.version = settings.LATEST_AGENT_VER
agent.site = Site.objects.get(name=site)
agent.agent_id = self.rand_string(40)

View File

@@ -95,6 +95,41 @@ disks_linux_deb = [
},
]
disks_mac = [
{
"free": "94.2 GB",
"used": "134.1 GB",
"total": "228.3 GB",
"device": "/dev/disk3s1s1",
"fstype": "apfs",
"percent": 58,
},
{
"free": "481.6 MB",
"used": "18.4 MB",
"total": "500.0 MB",
"device": "/dev/disk1s3",
"fstype": "apfs",
"percent": 3,
},
{
"free": "3.4 GB",
"used": "1.6 GB",
"total": "5.0 GB",
"device": "/dev/disk2s1",
"fstype": "apfs",
"percent": 32,
},
{
"free": "94.2 GB",
"used": "134.1 GB",
"total": "228.3 GB",
"device": "/dev/disk3s1",
"fstype": "apfs",
"percent": 58,
},
]
wmi_deb = {
"cpus": ["AMD Ryzen 9 3900X 12-Core Processor"],
"gpus": ["Cirrus Logic GD 5446"],
@@ -111,6 +146,22 @@ wmi_pi = {
"make_model": "Raspberry Pi 2 Model B Rev 1.1",
}
wmi_mac = {
"cpus": ["Apple M1"],
"gpus": [],
"disks": [
"Apple APPLE SSD AP0256Q SCSI SSD disk0 233.8 GB",
"Apple APPLE SSD AP0256Q SCSI SSD disk1 500.0 MB",
"Apple APPLE SSD AP0256Q SCSI SSD disk2 5.0 GB",
"Apple APPLE SSD AP0256Q SCSI SSD disk3 228.3 GB",
],
"local_ips": [
"192.168.45.113/24",
"fe80::476:c390:c8dc:11af/64",
],
"make_model": "MacBookAir10,1",
}
check_network_loc_aware_ps1 = r"""
$networkstatus = Get-NetConnectionProfile | Select NetworkCategory | Out-String