def __init__(self): lpr = LibparReader() self.cachedir = lpr.get("prober", "cachedir") if not os.path.isdir(self.cachedir): raise SzbException("incorrect cache dir '" + self.cachedir + "'") self.months = int(lpr.get("prober", "months_count")) if self.months <= 0: raise SzbException("months_count parameter in szarp.cfg must be grater then 0")
def getLocalParamdPort(): """ Returns local paramd port. """ lp = LibparReader() port = lp.get('paramd_for_raporter', 'port') if not port: port = "8081" return port
def __init__(self): lpr = LibparReader() self.cachedir = lpr.get("prober", "cachedir") if not os.path.isdir(self.cachedir): raise SzbException("incorrect cache dir '" + self.cachedir + "'") self.months = int(lpr.get("prober", "months_count")) if self.months <= 0: raise SzbException( "months_count parameter in szarp.cfg must be grater then 0")
def __init__(self): lpr = LibparReader() self.sub_addr = lpr.get("parhub", "sub_addr") self.pub_addr = lpr.get("parhub", "pub_addr") self.stdin_path = "/dev/null" self.stdout_path = "/var/log/szarp/parhub.stdin.log" self.stderr_path = "/var/log/szarp/parhub.stderr.log" self.pidfile_path = "/var/run/parhub.pid" self.pidfile_timeout = 5
def __init__(self): lpr = LibparReader() self.sub_addr = lpr.get("parhub", "sub_addr") self.pub_addr = lpr.get("parhub", "pub_addr") self.stdin_path = "/dev/null" self.stdout_path = "/var/log/szarp/parhub.stdin.log" self.stderr_path = "/var/log/szarp/parbub.stderr.log" self.pidfile_path = "/var/run/parhub.pid" self.pidfile_timeout = 5
def get_port_address(): """ Return (port, interface) tupple for reactor.listenTCP or internet.TCPServer. """ lpr = LibparReader() try: port = int(lpr.get("probes_server", "port")) except ValueError: raise RuntimeError("missing 'port' parameter in 'probes_server' section of szarp.cfg file") address = lpr.get("probes_server", "address") return (port, address)
def go(): lpr = LibparReader() path = lpr.get("global", "sz4dir") ipk = lpr.get("global", "IPK") uri = lpr.get("global", "parcook_socket_uri") heartbeat = int(lpr.get("sz4", "heartbeat_frequency")) m = meaner.Meaner(path, uri, heartbeat) m.configure(ipk) m.run()
def initializeZmq(self): if gb.hostname != "localhost": self.hub_uri = "tcp://" + gb.hostname + ":" + gb.portnumber else: self.hub_uri = LibparReader().get("parhub", "pub_conn_addr") self.context = zmq.Context(1) self.socket = self.context.socket(zmq.SUB) self.socket.connect(self.hub_uri) self.socket.setsockopt(zmq.SUBSCRIBE, "") self.poller = zmq.Poller() gb.sz4_ti = threading.Timer(1, update_zmq) gb.sz4_ti.start()
def go(): lpr = LibparReader() path = lpr.get("global", "sz4dir") ipk = lpr.get("global", "IPK") uri = lpr.get("parhub", "pub_conn_addr") heartbeat = int(lpr.get("sz4", "heartbeat_frequency")) interval = int(lpr.get("sz4", "saving_interval")) m = meaner.Meaner(path, uri, heartbeat, interval) m.configure(ipk) m.run()
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ import sys import meaner sys.path.append("/opt/szarp/lib/python") from libpar import LibparReader if __name__ == "__main__": lpr = LibparReader() path = lpr.get("global", "szbase") ipk = lpr.get("global", "IPK") uri = lpr.get("global", "paramd_uri") meaner = meaner.Meaner(uri) meaner.configure(ipk) menaer.run()