2015-04-20 02:12:11 +00:00
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
|
|
|
|
class Log(models.Model):
|
|
|
|
user = models.CharField(max_length=20, null=True)
|
2015-12-03 08:53:39 +00:00
|
|
|
host = models.CharField(max_length=200, null=True)
|
2015-04-20 02:12:11 +00:00
|
|
|
remote_ip = models.CharField(max_length=100)
|
2015-11-26 11:49:23 +00:00
|
|
|
login_type = models.CharField(max_length=100)
|
2015-04-20 02:12:11 +00:00
|
|
|
log_path = models.CharField(max_length=100)
|
|
|
|
start_time = models.DateTimeField(null=True)
|
2015-10-07 04:20:59 +00:00
|
|
|
pid = models.IntegerField()
|
2015-04-20 02:12:11 +00:00
|
|
|
is_finished = models.BooleanField(default=False)
|
|
|
|
end_time = models.DateTimeField(null=True)
|
|
|
|
|
|
|
|
def __unicode__(self):
|
2015-04-24 10:19:43 +00:00
|
|
|
return self.log_path
|
|
|
|
|
|
|
|
|
|
|
|
class Alert(models.Model):
|
|
|
|
msg = models.CharField(max_length=20)
|
|
|
|
time = models.DateTimeField(null=True)
|
2015-10-28 11:24:02 +00:00
|
|
|
is_finished = models.BigIntegerField(default=False)
|
|
|
|
|
|
|
|
|
|
|
|
class TtyLog(models.Model):
|
2015-10-28 14:32:16 +00:00
|
|
|
log = models.ForeignKey(Log)
|
2015-12-03 08:53:39 +00:00
|
|
|
datetime = models.DateTimeField(auto_now=True)
|
2015-10-28 11:24:02 +00:00
|
|
|
cmd = models.CharField(max_length=200)
|
2015-12-03 08:53:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ExecLog(models.Model):
|
|
|
|
user = models.CharField(max_length=100)
|
|
|
|
host = models.TextField()
|
|
|
|
cmd = models.TextField()
|
2015-12-03 10:49:04 +00:00
|
|
|
remote_ip = models.CharField(max_length=100)
|
2015-12-04 05:42:05 +00:00
|
|
|
result = models.TextField(default='')
|
2015-12-03 08:53:39 +00:00
|
|
|
datetime = models.DateTimeField(auto_now=True)
|
|
|
|
|
2015-12-03 15:24:34 +00:00
|
|
|
|
|
|
|
class FileLog(models.Model):
|
|
|
|
user = models.CharField(max_length=100)
|
|
|
|
host = models.TextField()
|
|
|
|
filename = models.TextField()
|
|
|
|
type = models.CharField(max_length=20)
|
|
|
|
remote_ip = models.CharField(max_length=100)
|
2015-12-04 05:42:05 +00:00
|
|
|
result = models.TextField(default='')
|
2015-12-03 15:24:34 +00:00
|
|
|
datetime = models.DateTimeField(auto_now=True)
|
|
|
|
|
|
|
|
|