https://github.com/seven-io/nagios
Official Nagios Plugin for seven.io
https://github.com/seven-io/nagios
nagios nagios-plugin seven-plugin sms
Last synced: 4 days ago
JSON representation
Official Nagios Plugin for seven.io
- Host: GitHub
- URL: https://github.com/seven-io/nagios
- Owner: seven-io
- License: mit
- Created: 2021-01-14T20:26:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2026-04-28T12:15:34.000Z (about 2 months ago)
- Last Synced: 2026-04-28T14:25:59.972Z (about 2 months ago)
- Topics: nagios, nagios-plugin, seven-plugin, sms
- Language: Python
- Homepage: https://www.seven.io/en/solutions/integrations/nagios/
- Size: 90.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
seven SMS for Nagios Core
Plugin for Nagios Core that sends SMS notifications via the seven gateway.
---
## Features
- **Native Nagios Plugin** - Drop-in `seven.py` script for `notify-host-by-sms` and `notify-service-by-sms` commands
- **Custom Sender** - Override the displayed sender via `--from`
- **Advanced SMS Options** - Flash, TTL, performance tracking, foreign ID, label
## Prerequisites
- Nagios Core
- Python 2 or 3
- A [seven account](https://www.seven.io/) with API key ([How to get your API key](https://help.seven.io/en/developer/where-do-i-find-my-api-key))
## Installation
Copy `seven.py` into the Nagios plugins directory (typically `/usr/local/nagios/libexec`).
## Configuration
### 1. Wire the contact
Edit `/usr/local/nagios/etc/objects/contacts.cfg`:
```cfg
define contact {
# ...
pager +491234567890
host_notification_commands notify-host-by-sms
service_notification_commands notify-service-by-sms
}
```
### 2. Define commands
Append to `/usr/local/nagios/etc/objects/commands.cfg`:
```cfg
define command {
command_name notify-service-by-sms
command_line python $USER1$/seven.py MY_SEVEN_API_KEY $CONTACTPAGER$ "$NOTIFICATIONTYPE$:$SERVICEDESC$ on $HOSTADDRESS$@$HOSTNAME$, State $SERVICESTATE$, Output: $SERVICEOUTPUT$, Date: $SHORTDATETIME$" --from=Nagios
}
define command {
command_name notify-host-by-sms
command_line python $USER1$/seven.py MY_SEVEN_API_KEY $CONTACTPAGER$ "$NOTIFICATIONTYPE$ on $HOSTADDRESS$@$HOSTNAME$, State: $HOSTSTATE$, Output: $HOSTOUTPUT$, Date: $SHORTDATETIME$" --from=Nagios
}
```
### 3. (optional) Add a quick-test service
Append to `/usr/local/nagios/etc/objects/localhost.cfg`:
```cfg
define service {
use local-service
host_name localhost
service_description SMS
check_command notify-host-by-sms
}
```
## Usage
```text
seven.py [-h] [--delay DELAY] [--flash] [--foreign_id FOREIGN_ID]
[--from FROM] [--label LABEL] [--performance_tracking]
[--ttl TTL] [--udh UDH]
api_key to text
```
## Support
Need help? Feel free to [contact us](https://www.seven.io/en/company/contact/) or [open an issue](https://github.com/seven-io/nagios/issues).
## License
[MIT](LICENSE)