# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2018-04-09 01:59
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='MonitorHost',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True, verbose_name='\u540d\u79f0')),
                ('address', models.CharField(max_length=32, unique=True, verbose_name='IP\u5730\u5740')),
                ('port', models.CharField(max_length=32, unique=True, verbose_name='\u7aef\u53e3')),
                ('status', models.CharField(default='enabled', max_length=15, verbose_name='\u72b6\u6001')),
                ('monitor_agent', models.CharField(default='down', max_length=5, verbose_name='Agent\u72b6\u6001')),
            ],
        ),
        migrations.CreateModel(
            name='MonitorItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, unique=True, verbose_name='\u540d\u79f0')),
                ('value', models.CharField(max_length=255, verbose_name='\u952e\u503c')),
            ],
        ),
        migrations.CreateModel(
            name='MonitorNotifyDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mode', models.CharField(max_length=10, verbose_name='\u901a\u77e5\u65b9\u5f0f')),
                ('theme', models.CharField(max_length=32, verbose_name='\u4e3b\u9898')),
                ('content', models.TextField(verbose_name='\u5185\u5bb9')),
                ('send_to', models.CharField(max_length=64, verbose_name='\u63a5\u6536\u4eba')),
                ('status', models.CharField(default='send', max_length=10, verbose_name='\u53d1\u9001\u72b6\u6001')),
            ],
        ),
        migrations.CreateModel(
            name='MonitorNotifyPolicy',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='\u540d\u79f0')),
                ('warning_threshold', models.CharField(max_length=255, verbose_name='warning\u9600\u503c')),
                ('danger_threshold', models.CharField(max_length=255, verbose_name='danger\u9600\u503c')),
                ('promote', models.CharField(max_length=255, verbose_name='\u544a\u8b66\u5347\u7ea7/\u6b21')),
            ],
        ),
        migrations.CreateModel(
            name='MonitorProblem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='\u540d\u79f0')),
                ('time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='\u65f6\u95f4')),
                ('address', models.CharField(max_length=32, verbose_name='\u4e3b\u673a')),
                ('level', models.CharField(max_length=16, verbose_name='\u7ea7\u522b')),
                ('status', models.CharField(default='unconfirmed', max_length=16, verbose_name='\u72b6\u6001')),
            ],
        ),
        migrations.CreateModel(
            name='MonitorTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, unique=True, verbose_name='\u540d\u79f0')),
                ('interval', models.CharField(max_length=5, verbose_name='\u76d1\u63a7\u9891\u7387')),
                ('items', models.ManyToManyField(to='monitor_master.MonitorItem', verbose_name='\u76d1\u63a7\u9879')),
                ('policy', models.ManyToManyField(to='monitor_master.MonitorNotifyPolicy', verbose_name='\u544a\u8b66\u7b56\u7565')),
            ],
        ),
        migrations.AddField(
            model_name='monitorhost',
            name='template',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='monitor_master.MonitorTemplate', verbose_name='\u6a21\u7248'),
        ),
    ]
