This package provides a set of common notification commands to accompany the
randomhost/icinga
package.
CmDotCom
is currently the only available notification plugin.
Sends notifications using CM.com.
<?php
use randomhost\Icinga\Notification\CmDotCom\Factory;
include $_composer_autoload_path ?? __DIR__.'/../../vendor/autoload.php';
$notification = (new Factory())->getNotification();
$notification
->setOptions(
getopt(
$notification->getShortOptions(),
$notification->getLongOptions()
)
)
->run()
;
echo $notification->getMessage();
exit($notification->getCode());
This will instantiate the CM.com notification plugin and send a text message to the phone number provided on the command line.
Parameter | Description |
---|---|
--type |
Notification type |
--service |
Service name |
--host |
Host name |
--address |
Host address |
--state |
Service state |
--time |
Notification time |
--output |
Check plugin output |
--phone |
Phone number in international format (e.g. +12065550199) |
--apikey |
CM.com API key |
See LICENSE.txt for full license details.