# Path: ping/models.py
# class PingHost(models.Model):
#     hostname = models.CharField(max_length = global_max_length)
#     active = models.BooleanField(default = True)
# 
#     def __unicode__(self):
#         return self.hostname
# 
# class PingResult(models.Model):
#     host = models.ForeignKey(PingHost)
#     min_delay = models.DecimalField(max_digits = 10, decimal_places = 3)
#     avg_delay = models.DecimalField(max_digits = 10, decimal_places = 3)
#     max_delay = models.DecimalField(max_digits = 10, decimal_places = 3)    
#     stddev = models.DecimalField(max_digits = 10, decimal_places = 3)
#     at = models.DateTimeField(auto_now_add = True)
# 
#     def __unicode__(self):
#         return unicode(self.host) + u" " + str(self.avg_delay) + " at " + str(self.at)


from django.core.management import setup_environ
from ping.models import PingHost, PingResult
import settings
import time
import ping.ping as pinger
import logging
#!/usr/bin/python

setup_environ(settings)


while True:
    ping_hosts = PingHost.objects.filter(active = True)

# Path: ping/models.py
# class PingHost(models.Model):
#     hostname = models.CharField(max_length = global_max_length)
#     active = models.BooleanField(default = True)
# 
#     def __unicode__(self):
#         return self.hostname
# 
# class PingResult(models.Model):
#     host = models.ForeignKey(PingHost)
#     min_delay = models.DecimalField(max_digits = 10, decimal_places = 3)
#     avg_delay = models.DecimalField(max_digits = 10, decimal_places = 3)
#     max_delay = models.DecimalField(max_digits = 10, decimal_places = 3)    
#     stddev = models.DecimalField(max_digits = 10, decimal_places = 3)
#     at = models.DateTimeField(auto_now_add = True)
# 
#     def __unicode__(self):
#         return unicode(self.host) + u" " + str(self.avg_delay) + " at " + str(self.at)


# Path: action_daemon_ping.py
from django.core.management import setup_environ
from ping.models import PingHost, PingResult
import settings
import time
import ping.ping as pinger
import logging

#!/usr/bin/python

setup_environ(settings)


while True:
    ping_hosts = PingHost.objects.filter(active = True)

    time.sleep(5)    