Ejemplo n.º 1
0
def main():
    timeout = 10  # default
    args = parser()
    check = nagiosplugin.Check(
        ZookeeperZnode(args), stringContext.StringContext('true', True),
        stringContext.StringContext('false', False),
        nagiosplugin.ScalarContext('total_topics', args.warn_topics,
                                   args.crit_topics),
        nagiosplugin.ScalarContext('hosts', args.warn_hosts, args.crit_hosts))
    if args.test == "kafka":
        timeout = 0
    check.main(timeout=timeout)
Ejemplo n.º 2
0
def main():
    timeout = 30  # default
    args = parser()
    check = nagiosplugin.Check(
        KafkaTopics(args),
        stringContext.StringContext(
            'Under Replication',
            None,
            fmt_metric='{value} partitions are under replicated'),
        stringContext.StringContext('Unavailability',
                                    None,
                                    fmt_metric='{value} are unavailables'))
    check.main()
Ejemplo n.º 3
0
def main():
    args = parser()
    check = nagiosplugin.Check(
        Resourcemanager(args), stringContext.StringContext('state', 'STARTED'),
        stringContext.StringContext('nodeState', 'RUNNING'),
        nagiosplugin.ScalarContext('unhealthy', args.unhealthy_warn,
                                   args.unhealthy_crit),
        nagiosplugin.ScalarContext('lost', args.lost_warn, args.lost_crit),
        nagiosplugin.ScalarContext('rebooted', args.rebooted_warn,
                                   args.rebooted_crit),
        nagiosplugin.ScalarContext('appsPending', args.apps_warn,
                                   args.apps_crit))
    check.main()
Ejemplo n.º 4
0
def main():
    args = parser()
    check = nagiosplugin.Check(
        Zookeeper(args.hosts),
        stringContext.StringContext('running',
                                    True,
                                    fmt_metric='ZK Server running {value}'),
        stringContext.StringContext('writable',
                                    True,
                                    fmt_metric='Path writable {value}'),
        stringContext.StringContext('version',
                                    args.version,
                                    fmt_metric='Runnng version is {value}'),
        nagiosplugin.ScalarContext('latency', args.latency_warning,
                                   args.latency_critical),
        stringContext.StringContext('mode',
                                    '1/%d' % (len(args.hosts.split(',')) - 1),
                                    fmt_metric='leader/followers {value}'))
    check.main()
Ejemplo n.º 5
0
def main():
    args = parser()
    check = nagiosplugin.Check(
        Hdfs(args),
        stringContext.StringContext('active nn',
                                    1,
                                    fmt_metric='{value} active namenodes'),
        stringContext.StringContext('standby nn',
                                    len(args.namenodes.split(',')) - 1,
                                    fmt_metric='{value} standby namenodes'),
        nagiosplugin.ScalarContext('used',
                                   args.warning_used,
                                   args.critical_used,
                                   fmt_metric='{value}% storage in use'),
        nagiosplugin.ScalarContext('total_blocks',
                                   args.warning_blocks,
                                   args.critical_blocks,
                                   fmt_metric=' is using {value} blocks'),
        nagiosplugin.ScalarContext(
            'ureplicated',
            args.warning_ureplicated,
            args.critical_ureplicated,
            fmt_metric='{value} under replicated blocks'),
        nagiosplugin.ScalarContext('missing',
                                   args.warning_missing,
                                   args.critical_missing,
                                   fmt_metric='{value} missing blocks'),
        nagiosplugin.ScalarContext('corrupt',
                                   args.warning_corrupt,
                                   args.critical_corrupt,
                                   fmt_metric='{value} corrupted blocks'),
        nagiosplugin.ScalarContext(
            'balanced',
            args.warning_balanced,
            args.critical_balanced,
            fmt_metric='There are {value}% usage difference between datanodes'
        ),
        stringContext.StringContext('datanodes',
                                    args.critical_datanodes,
                                    fmt_metric='{value} living datanodes'),
        HdfsSummary())
    check.main()
Ejemplo n.º 6
0
def main():
    args = parser()
    check = nagiosplugin.Check(
        Httpfs(args),
        stringContext.StringContext('type',
                                    args.type,
                                    fmt_metric=' is a {value}'),
        stringContext.StringContext('owner',
                                    args.owner,
                                    fmt_metric=' owner is {value}'),
        stringContext.StringContext('group',
                                    args.group,
                                    fmt_metric=' group is {value}'),
        stringContext.StringContext('permission',
                                    args.permission,
                                    fmt_metric=' has {value} permission'),
        stringContext.StringContext('writable',
                                    True,
                                    fmt_metric='HTTPFS writable: {value}'))
    check.main()
def main():
    args = parser()
    check = nagiosplugin.Check(
        QJM(args),
        nagiosplugin.ScalarContext('processing', args.process_warn,
                                   args.process_crit),
        nagiosplugin.ScalarContext('sync', args.sync_threshold_warn,
                                   args.sync_threshold_crit),
        stringContext.StringContext('connection', "OK"),
        nagiosplugin.ScalarContext(
            'quorum',
            nagiosplugin.Range("%s:" % str(len(args.qjm.split(',')) / 2)),
            nagiosplugin.Range("%s:" % str(len(args.qjm.split(',')) / 2))))
    check.main()
Ejemplo n.º 8
0
def main():
    timeout = 10  # default
    args = parser()
    check = nagiosplugin.Check(
        StormTopology(args),
        stringContext.StringContext('connected',
                                    True,
                                    fmt_metric='Connection status: {value}'),
        nagiosplugin.ScalarContext('1d load', args.load_1d_warn,
                                   args.load_1d_crit),
        nagiosplugin.ScalarContext('3h load', args.load_3h_warn,
                                   args.load_3h_crit),
        nagiosplugin.ScalarContext('10m load', args.load_10m_warn,
                                   args.load_10m_crit))
    check.main(timeout=timeout)
Ejemplo n.º 9
0
def main():
    args = parser()
    check = nagiosplugin.Check(Historyserver(args),
        stringContext.StringContext('hs_status',
            True))
    check.main()
Ejemplo n.º 10
0
def main():
    args = parser()
    check = nagiosplugin.Check(Hbase(args),
        stringContext.StringContext('status',
            'OK'))
    check.main()