示例#1
0
 def __init__(self):
     '''
     Constructor
     '''
     self._dataParser = None
     self._jsDataFile = None
     configFileReader = ConfigFileReader()
     self._jsFilePath = configFileReader.read(Constants.SEC_MAIN,
                                              Constants.OPT_INSTALL_FOLDER)
     self._jsFilePath += Constants.JS_DATA_FILE_REL_PATH
示例#2
0
 def _createVnStatDumpFile(self):
     '''
     The method will dump the content of the vnstat db to the a file.
     
     @param outFile: the name of the file that will contain the vnstat db
     '''
     configReader = ConfigFileReader()
     vnstatCmd = configReader.read(Constants.SEC_VNSTAT,
                                               Constants.OPT_VNSTAT_CMD)
     networkCard = configReader.read(Constants.SEC_NETWORK_CARD,
                                               Constants.OPT_CARD_NAME)
     self._openVnStatDumpFile('w')
     self._vnStatDumpFile.write(commands.getoutput(vnstatCmd + " --dumpdb -i " + networkCard))
     self._closeVnStatDumpFile()