forked from Azimut-Prod/azimut-gestion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lastest changes from internal version: Logstash management, user serv…
…er delegation , force http at home page, and misc fi
- Loading branch information
Showing
45 changed files
with
1,681 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.pyc | ||
*.pyc | ||
.ropeproject/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.forms import ModelForm | ||
|
||
from logstash.models import File | ||
|
||
from servers.models import Server | ||
|
||
|
||
class FileForm(ModelForm): | ||
class Meta: | ||
model = File | ||
exclude = () | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(FileForm, self).__init__(*args, **kwargs) | ||
|
||
self.fields["server"].queryset = Server.objects.order_by('name').filter(logstash_shipper=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# -*- coding: utf-8 -*- | ||
import datetime | ||
from south.db import db | ||
from south.v2 import SchemaMigration | ||
from django.db import models | ||
|
||
|
||
class Migration(SchemaMigration): | ||
|
||
def forwards(self, orm): | ||
# Adding model 'File' | ||
db.create_table(u'logstash_file', ( | ||
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), | ||
('server', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['servers.Server'])), | ||
('file', self.gf('django.db.models.fields.CharField')(max_length=255)), | ||
('type', self.gf('django.db.models.fields.CharField')(max_length=255)), | ||
('tags', self.gf('django.db.models.fields.CharField')(max_length=512)), | ||
)) | ||
db.send_create_signal(u'logstash', ['File']) | ||
|
||
|
||
def backwards(self, orm): | ||
# Deleting model 'File' | ||
db.delete_table(u'logstash_file') | ||
|
||
|
||
models = { | ||
u'logstash.file': { | ||
'Meta': {'object_name': 'File'}, | ||
'file': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'server': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['servers.Server']"}), | ||
'tags': ('django.db.models.fields.CharField', [], {'max_length': '512'}), | ||
'type': ('django.db.models.fields.CharField', [], {'max_length': '255'}) | ||
}, | ||
u'servers.server': { | ||
'Meta': {'object_name': 'Server'}, | ||
'external_hostname_for_vms_creation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'external_interface': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), | ||
'external_ip': ('django.db.models.fields.IPAddressField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), | ||
'hostname_for_vms_creation': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'internal_ip': ('django.db.models.fields.IPAddressField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), | ||
'is_proxmox': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'is_vm': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'keymanger_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), | ||
'logstash_shipper': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
'ngnix_server': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'ngnixed_server_set'", 'null': 'True', 'to': u"orm['servers.Server']"}), | ||
'proxmox_node_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'samba_base_folder': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'samba_management': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'ssh_connection_string_from_backup': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'ssh_connection_string_from_gestion': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'vm_host': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'server_set'", 'null': 'True', 'to': u"orm['servers.Server']"}) | ||
} | ||
} | ||
|
||
complete_apps = ['logstash'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# -*- coding: utf-8 -*- | ||
import datetime | ||
from south.db import db | ||
from south.v2 import SchemaMigration | ||
from django.db import models | ||
|
||
|
||
class Migration(SchemaMigration): | ||
|
||
def forwards(self, orm): | ||
# Adding model 'Execution' | ||
db.create_table(u'logstash_execution', ( | ||
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), | ||
('output', self.gf('django.db.models.fields.TextField')()), | ||
('done', self.gf('django.db.models.fields.BooleanField')(default=False)), | ||
('sugested_result', self.gf('django.db.models.fields.TextField')()), | ||
)) | ||
db.send_create_signal(u'logstash', ['Execution']) | ||
|
||
|
||
def backwards(self, orm): | ||
# Deleting model 'Execution' | ||
db.delete_table(u'logstash_execution') | ||
|
||
|
||
models = { | ||
u'logstash.execution': { | ||
'Meta': {'object_name': 'Execution'}, | ||
'done': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'output': ('django.db.models.fields.TextField', [], {}), | ||
'sugested_result': ('django.db.models.fields.TextField', [], {}) | ||
}, | ||
u'logstash.file': { | ||
'Meta': {'object_name': 'File'}, | ||
'file': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'server': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['servers.Server']"}), | ||
'tags': ('django.db.models.fields.CharField', [], {'max_length': '512'}), | ||
'type': ('django.db.models.fields.CharField', [], {'max_length': '255'}) | ||
}, | ||
u'servers.server': { | ||
'Meta': {'object_name': 'Server'}, | ||
'external_hostname_for_vms_creation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'external_interface': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), | ||
'external_ip': ('django.db.models.fields.IPAddressField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), | ||
'hostname_for_vms_creation': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'internal_ip': ('django.db.models.fields.IPAddressField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), | ||
'is_proxmox': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'is_vm': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'keymanger_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), | ||
'logstash_shipper': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
'ngnix_server': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'ngnixed_server_set'", 'null': 'True', 'to': u"orm['servers.Server']"}), | ||
'proxmox_node_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'samba_base_folder': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'samba_management': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'ssh_connection_string_from_backup': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'ssh_connection_string_from_gestion': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'vm_host': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'server_set'", 'null': 'True', 'to': u"orm['servers.Server']"}) | ||
} | ||
} | ||
|
||
complete_apps = ['logstash'] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from django.db import models | ||
|
||
|
||
from servers.models import Server | ||
|
||
|
||
class File(models.Model): | ||
"""A file to monitor""" | ||
|
||
server = models.ForeignKey(Server) | ||
|
||
file = models.CharField(max_length=255) | ||
|
||
TYPE_CHOICES = (('apachelog', 'Apache log'), ('syslog', 'Syslog'), ('misc', 'Misc')) | ||
type = models.CharField(max_length=255, choices=TYPE_CHOICES) | ||
|
||
tags = models.CharField(max_length=512) | ||
|
||
def sorted_tags(self): | ||
"""Return the list of tags, sorted""" | ||
return ','.join(sorted(self.tags.split(','))) | ||
|
||
|
||
|
||
|
||
class Execution(models.Model): | ||
|
||
output = models.TextField() | ||
done = models.BooleanField(default=False) | ||
sugested_result = models.TextField() |
Oops, something went wrong.