DirectAdmin Push notifications with Pushover

DirectAdmin Pushover NotificationsDirectAdmin has a great notification system that sends Admin messages to your e-mail. And CustomBuild also supports e-mail notifications for new software updates when you use the CustomBuild cronjob. With the Pushover API and the mobile app, it is very easy to receive all these messages from DirectAdmin & CustomBuild immediately to your iOS or Android device as Push Notifications! So if there is an issue with brute force attempts or if backups are failing, with Push Notifications you are immediately notified so you can take action quickly.

Setup Pushover

First, you need an account with Pushover. Follow the steps on the website to create a new account or sign in with your existing account.

When logged in, scroll down until you see “Your Applications (Create an Application/API Token)”. Click Create to start adding an application.

Pushover Create new Application

  • Name
    • Enter your server hostname for example
  • Description
    • Optional
  • URL
    • Optional, you can leave this blank
  • Icon
    • Optional

Click the checkbox to agree to the terms and now you have created a new application. You should now see your API Token/Key. The User Key is also a key you’ll need, which you can find on your dashboard.

DirectAdmin Push scripts

To receive Push notifications whenever there is a notification from DirectAdmin, you need to add a few scripts and use the hooks from DirectAdmin.

    • This is the main script for sending notitications
    • This is the script that is used in the CustomBuild cronjob
    • This is the script that is called by DirectAdmin if the admin user receives an message in the notification system

This is the main script for sending notifications to Pushover. It accepts a title and message as parameters.

cd /root
mkdir pushover
cd pushover
chmod 700

#API keys.

# Create the title and message strings, and cut them off after x characters for Pushover to accept them.

# Send the message.
curl -s -o /dev/null \
--form-string "token=${PUSHOVER_APP_TOKEN}" \
--form-string "user=${PUSHOVER_USER_KEY}" \
--form-string "title=${NOTIFICATION_TITLE}" \
--form-string "message=${NOTIFICATION_MESSAGE}" \

As you can already see, enter your Pushover App Token & User Key. You can already test if sending notifications is working by running:

./ "Title" "This is a test message"

If you receive no errors and the App Token & User Key was set up correctly, you should now receive a push message on your configured devices on Pushover. If the title and message parameters are too long, they are cut off because Pushover doesn’t accepts strings longer then 248 characters for the title and 1020 characters for the message.

Script for CustomBuild update notifications:

cd /usr/local/directadmin/custombuild/custom/
mkdir hooks
cd hooks
mkdir cron_execute
cd cron_execute
mkdir post
cd post
chmod 700

cd /usr/local/directadmin/custombuild
AVAIL_UPDATES="`./build versions_nobold | grep -c -e 'update is available.'`"
if [ "${AVAIL_UPDATES}" -gt 0 ]; then
/root/pushover-notification/ "`hostname`: ${AVAIL_UPDATES} updates available" "$(./build versions_nobold | grep 'update is available.')"

exit 0;

Now if there are any updates available in CustomBuild you will receive a push message alongside the standard e-mail message!

DirectAdmin system (admin) messages

Create the script, executed by DirectAdmin after the Admin user receives a message in the notification system:

cd /usr/local/directadmin/scripts/custom/
(if the custom dir does not exists, create it)
chmod 700

Place this script in the newly created file:


# Notification and Email Title.
NOTIFICATION_ALERT_TITLE="`hostname`: DirectAdmin Message"



Now if there are messages send to a admin user, you will also receive in instant push notification to your mobile devices!

DirectAdmin Push Notifications: GitHub repository

If you have any suggestions or improvements, open an Issue or Pull Request on the GitHub repository.