Exemple #1
0
def check_http():
    poller = NagiosPoller()
    args = ArgSet()
    args.add_argument_pair("-H", "liukang.tryolabs.com")
    args.add_argument_pair("-p", "80")
    res = poller.run_plugin('check_http', args)
    print "\n",res.command,"\nRET CODE:\t",res.returncode,"\nOUT:\t\t",res.output,"\nERR:\t\t",res.error
Exemple #2
0
def check_ping():
    poller = NagiosPoller()
    args = ArgSet()
    args.add_argument_pair("-H", "google.com")
    args.add_argument_pair("-w", "200.0,20%")
    args.add_argument_pair("-c", "500.0,60%")
    res = poller.run_plugin('check_ping', args)
    print "\n",res.command,"\nRET CODE:\t",res.returncode,"\nOUT:\t\t",res.output,"\nERR:\t\t",res.error
Exemple #3
0
def check_pgsql():
    poller = NagiosPoller()
    args = ArgSet()
    args.add_argument_pair("-H", "localhost")
    args.add_argument_pair("-d", "daywatch_db")
    args.add_argument_pair("-p", "postgres")
    res = poller.run_plugin('check_pgsql', args)
    print "\n", res.command, "\nRET CODE:\t", res.returncode, "\nOUT:\t\t", res.output, "\nERR:\t\t", res.error
Exemple #4
0
def check_disk():
    poller = NagiosPoller()
    args = ArgSet()
    args.add_argument_pair("-u", "GB")
    args.add_argument_pair("-w", "5")
    args.add_argument_pair("-c", "2")
    args.add_argument_pair("-p", "/")
    res = poller.run_plugin('check_disk', args)
    print "\n", res.command, "\nRET CODE:\t", res.returncode, "\nOUT:\t\t", res.output, "\nERR:\t\t", res.error
Exemple #5
0
def check_pgsql():
    poller = NagiosPoller()
    args = ArgSet()
    args.add_argument_pair("-H", "localhost")
    args.add_argument_pair("-d", "daywatch_db")
    args.add_argument_pair("-p", "postgres")
    res = poller.run_plugin('check_pgsql', args)
    print "\n",res.command,"\nRET CODE:\t",res.returncode,"\nOUT:\t\t",res.output,"\nERR:\t\t",res.error
Exemple #6
0
def check_disk():
    poller = NagiosPoller()
    args = ArgSet()
    args.add_argument_pair("-u", "GB")
    args.add_argument_pair("-w", "5")
    args.add_argument_pair("-c", "2")
    args.add_argument_pair("-p", "/")
    res = poller.run_plugin('check_disk', args)
    print "\n",res.command,"\nRET CODE:\t",res.returncode,"\nOUT:\t\t",res.output,"\nERR:\t\t",res.error
Exemple #7
0
def check_http():
    poller = NagiosPoller()
    args = ArgSet()
    args.add_argument_pair("-H", "liukang.tryolabs.com")
    args.add_argument_pair("-p", "80")
    res = poller.run_plugin('check_http', args)
    print "\n", res.command, "\nRET CODE:\t", res.returncode, "\nOUT:\t\t", res.output, "\nERR:\t\t", res.error
Exemple #8
0
def check_ping():
    poller = NagiosPoller()
    args = ArgSet()
    args.add_argument_pair("-H", "google.com")
    args.add_argument_pair("-w", "200.0,20%")
    args.add_argument_pair("-c", "500.0,60%")
    res = poller.run_plugin('check_ping', args)
    print "\n", res.command, "\nRET CODE:\t", res.returncode, "\nOUT:\t\t", res.output, "\nERR:\t\t", res.error
Exemple #9
0
 def plugin_help(self, plugin_name):
     """invoke --help on the named plugin, return the results"""
     argset = ArgSet()
     argset.add_argument('--help')
     return self.run_plugin(plugin_name, argset)
Exemple #10
0
 def plugin_help(self, plugin_name):
     """invoke --help on the named plugin, return the results"""
     argset = ArgSet()
     argset.add_argument('--help')
     return self.run_plugin(plugin_name, argset)