Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_gmailunread.py

Current Version
v0.1.0
Last Release Date
2012-08-01
Compatible With
  • Nagios 3.x
  • Nagios XI
  • Nagios Fusion
License
GPL
Hits
59754
Files:
FileDescription
check_gmailunread.pycheck_gmailunread.py
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
check_gmailunread.py
Simple imap python script to check the number of unread emails in a gmail account and alert based on the specified WARN and CRIT parameters.
peter@blackbird:~/Code/nagiosplugins$ ./check_gmailunread.py
Error: no gmail user specified.
Usage: check_gmailunread.py -u email_user -p email_password -w warn_unread -c crit_unread
check_gmailunread.py -h for detailed help
check_gmailunread.py -V for version information


peter@blackbird:~/Code/nagiosplugins$ ./check_gmailunread.py -h
Nagios plugin to check how many unread emails are in a gmail account

Usage: check_gmailunread.py -u email_user -p email_password -w warn_unread -c crit_unread
check_gmailunread.py -h for detailed help
check_gmailunread.py -V for version information

Options:
-h
Print this help message.
-V
Print version information then exit.
-u gmail_user
User name of the gmail account.
For google enterprise accounts use the full email address:
eg, your.email@yourcompany.com
-p gmail_password
Password of the gmail account.
-w warn_count
Warning threshold count for unread emails.
-c crit_count
Critical threshold count for unread emails.


EXAMPLES:

Use full gmail email address:

peter@blackbird:~/Code/nagiosplugins$ ./check_gmailunread.py -u joe.smith@gmail.com -p secretpassword -w 150 -c 350
Unread email count for joe.smith@gmail.com is 238: WARNING
peter@blackbird:~/Code/nagiosplugins$

Use only gmail account name:

peter@blackbird:~/Code/nagiosplugins$ ./check_gmailunread.py -u joe.smith -p secretpassword -w 150 -c 350
Unread email count for joe.smith is 238: WARNING
peter@blackbird:~/Code/nagiosplugins$