How to customize an email report on K1000
I have a report that runs and tell me all the computers that have 20% or less disk space left. the only problem is the report only gives me the computer name, system description , MAC and IP addresses. I would also like the report to include just how much space is left on the drives in question
here is my current sql query. I dont really know anything about sql but if someone could make a sql query that would accomplish this, I can copy and paste it.
select *, UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(LAST_SYNC) as LAST_SYNC_TIME,
UNIX_TIMESTAMP(MACHINE.LAST_SYNC) as LAST_SYNC_SECONDS
LEFT JOIN KBSYS.KUID_ORGANIZATION ON KUID_ORGANIZATION.KUID=MACHINE.KUID LEFT JOIN KBSYS.SMMP_CONNECTION ON SMMP_CONNECTION.KUID = MACHINE.KUID AND KUID_ORGANIZATION.ORGANIZATION_ID = 1
where ((( (1 in (select 1 from ORG1.MACHINE_DISKS where MACHINE.ID = MACHINE_DISKS.ID and MACHINE_DISKS.DISK_FREE < '20%')) ) OR RAM_TOTAL = '80%'))
Community Chosen Answer
Will this work for you? It's not getting all the info that "*" will get you.
select MACHINE.NAME, MACHINE.SYSTEM_DESCRIPTION, MACHINE.IP, MACHINE.MAC, MACHINE_DISKS.PERCENT_USED, MACHINE_DISKS.DISK_FREE,MACHINE_DISKS.NAME as DISK_NAME from ORG1.MACHINE join MACHINE_DISKS on (MACHINE.ID = MACHINE_DISKS.ID) left join KBSYS.KUID_ORGANIZATION on KUID_ORGANIZATION.KUID=MACHINE.KUID left join KBSYS.SMMP_CONNECTION on SMMP_CONNECTION.KUID = MACHINE.KUID and KUID_ORGANIZATION.ORGANIZATION_ID = 1 where MACHINE_DISKS.PERCENT_USED > '80' or RAM_TOTAL = '80%' order by MACHINE.NAME