Statistics
| Branch: | Revision:

root / graphs / management / commands / clear_rrds.py @ 04733cdb

History | View | Annotate | Download (927 Bytes)

1
# -*- coding: utf-8 -*- vim:encoding=utf-8:
2
# vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab
3

    
4
from django.core.management.base import BaseCommand, CommandError
5
from django.conf import settings
6
import sys
7
import os
8

    
9

    
10
class Command(BaseCommand):
11
#    help = "Creates the configuration for rg project. Will output mrtg, collectd and munin configuration files as well as populate accordingly the rg database."
12
#    args = "[[device]]"
13
#    label = "Domain of devices to be run for(e.g. example.com) and type of configuration run(or all if you wish everything). An optional device name can also be given to run the program for a single node. Valid types are" + ", ".join(settings.RG_CREATE_TYPES) 
14

    
15
    def handle(self, *args, **options):
16
        dir = os.listdir(settings.RRDFILEDIR)
17
        for fname in dir:
18
            os.remove("%s/%s"%(settings.RRDFILEDIR,fname))
19
            print "Removed %s"%fname
20
        print "done"