Giter Club home page Giter Club logo

check_mailbox's Introduction

check_mailbox

This command will check if a mailbox is available using pop(s) or imap(s). It supports performance data.

Usage

check_imap [OPTIONS]
  [OPTIONS]:
  -H HOST           Full host string, i.E. "imaps://mail.local.ch:993" OR "pop3://mail.local.ch:143"
  -C CREDENTIAL     Username:Password, i.E. "user2:horsestaplebattery" (default: no auth)
  -M MAILBOX        Mailbox Name, needed for IMAP(s) only (default: INBOX)
  -I INSECURE       Allow insecure connections using IMAPs and POP3s (default: OFF)
  -S SSL            Try to use SSL/TLS for the connection (default: OFF)
  -V VERBOSE        Use verbose mode of CURL for debugging (default: OFF)
  -c CRITICAL       Critical threshold for execution in milliseconds (default: 3500)
  -w WARNING        Warning threshold for execution in milliseconds (default: 2000)
  -n MIN_MESSAGES   Minimum expected number of messages in inbox (default: 0)
  -N MAX_MESSAGES   Maximum expected number of messages in inbox (default: 100000000)

Example of connecting via pop3 on port 5050, setting a critical timeout of 3.2 seconds and providing username and password:

./check_mailbox.sh -H "pop3://pop3.mail.local.ch:5050" -c 3200 -C "user:p4$$w0rd_;)"
OK: MAILBOX LIST in 314 ms | value=314;2000;3200;0;3200 messagecount=2;

Example of connecting via insecure imaps on port 993 and verbosity on

./check_mailbox.sh -H "imaps://mailer.local.ch:993" -I
OK: MAILBOX LIST in 304 ms | value=304;2000;3200;0;3200 messagecount=2;

Example of connecting via pop3 setting the verbose flag and using the default port by omitting it:

./check_mailbox.sh -H "pop3://127.0.0.1" -c 3200 -C "user:p4ss"  -V
* Rebuilt URL to: pop3://127.0.0.1/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 110 (#0)
< +OK Dovecot ready.
> CAPA
< +OK
< CAPA
< TOP
< UIDL
< RESP-CODES
< PIPELINING
< AUTH-RESP-CODE
< USER
< SASL PLAIN
< .
> AUTH PLAIN
< + 
> dXNlcgB1c2VyAHA0c3M=
< +OK server ready
> LIST
< +OK 2 messages
* Connection #0 to host 127.0.0.1 left intact
OK: MAILBOX LIST in 286 ms | value=286;2000;3500;0;3500 messagecount=2;

Command Template

object CheckCommand "check-mailbox" {
  command = [ ConfigDir + "/scripts/check_mailbox.sh" ]
  arguments += {
    "-H" = "$chm_host$"
    "-C" = "user:password"
    "-M" = "INBOX"
    "-S" = {
           set_if = "$ssl$"
    }
    "-w" = "1000"
    "-c" = "2000"
  }
}

check_mailbox's People

Contributors

ni-kweutzing avatar ozzi- avatar toadjaune avatar

Stargazers

 avatar  avatar

Watchers

 avatar

check_mailbox's Issues

How to use check_mailbox with icinga2

Hi,

I have a stupid problem, but i don't understand how can I use this script with icingaweb2.
I juste want to watch the total number of my mail from my mailbox on icigaweb2.
i just have to modify command.conf ? or service.conf too ? or anything else.

thanks for your help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.