What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How can PRTG send instant messages to Jabber, ICQ, MSN, Yahoo, etc., using external software?

Votes:

0

I would like to send notifications to instant messengers such as AIM, Facebook, Gadu-Gadu, IAX (Inter-Asterisk Exchange), ICQ, IRC (Internet Relay Chat), Jabber, MSN, Netsend, Tlen, Yahoo, Google Talk (GTalk), Skype, or Bonjour. Is it possible to do this using external software controlled via command line?

custom-notification google-talk icq im instant-messaging jabber msn prtg yahoo

Created on Jan 25, 2011 2:00:54 PM by  Daniel Zobel [Product Manager]

Last change on May 6, 2019 11:49:45 AM by  Maike Guba [Paessler Support] (2,404) 2 1



4 Replies

Accepted Answer

Votes:

0

This article applies as of PRTG 22

Important notice: We cannot provide guarantees that the approach below still works with the involved external tools.

Use custom notifications to send instant messages

Using the Execute Program notifications option of PRTG, you can use an instant messenger with command line capabilities to send messages via virtually any instant messaging protocol. This article will show an example of how to send notifications to an ICQ account, using a combination of the following programs:


Known issue: The described setup might not work with Windows Server 2012.

Step 1: Install and prepare Miranda

  • Download Miranda IM and install it on your computer in Portable Mode (this is an option during setup), so you can move it to your PRTG server later on.
  • In Miranda IM, set up an ICQ account dedicated to sending messages for PRTG (sign up for a new one, if necessary). Add all future recipients of notifications to this account's contact list and test if messages are received on the other side.
    Note: Although this is an example for ICQ, you can add any other account using one of the supported protocols, for example Jabber, MSN, or others.
  • Write down the possible recipients' ICQ numbers—you will need them later.
  • Download the Command Line plugin and extract it to your Miranda installation directory. To check, make sure the file CmdLine.dll is in the \Plugins subfolder after extraction.

Step 2: Move Miranda to PRTG server system

Note: If you run a cluster, you need to perform the actions in this step on every single node to make sure that notifications are also available in case the Master Node fails.

  • Copy the Miranda IM directory to the system that is running your PRTG core server. You can choose any directory, for example C:\Miranda IM
  • Move the file MimCmd.exe from the Miranda installation directory to the \Notifications\EXE subfolder of your PRTG program directory.

Step 3: Configure Miranda as a Windows service

Now comes the tricky part: You have to make sure that the file miranda32.exe (or miranda64.exe respectively) from the Miranda IM directory and the PRTG Server.exe system service (which is the core server of PRTG) are running under the same Windows user account. For PRTG, this is the local Windows "system" account by default. One way is to register the Miranda EXE file as a Windows service, started under the local Windows "system" account.

Note: If you run a cluster, you need to perform the actions in this step on every single node to make sure that notifications are also available in case the Master Node fails.

  • Download NSSM—the Non-Sucking Service Manager, an open source command line tool that lets you easily run an EXE file as a Windows service, and install it. Extract the ZIP file to a directory on the system that is running your PRTG core server, for example C:\nssm.
  • On the Windows command line, enter a command to register Miranda as a service, for example: C:\nssm\win32> nssm.exe install MirandaIM
  • In a GUI window, you will be prompted to enter the path to the application that you wish to run as a service, and any command line options to send to it (see NSSM usage documentation). Enter the path to the Miranda application, for example C:\Miranda IM\miranda32.exe, and a service name, for example MirandaIM. You do not need to enter any options. Click on Install service. The service is added with the start type "Automatic".
  • In the Windows Computer Management console (compmgmt.msc), view the list of services and manually start the newly created service MirandaIM. It should be started under the Windows local "system" account (check this in the task manager). After a successful start, you should see the configured ICQ account as "online" in any of the recipients' messengers. This is mandatory to receive messages later.

Step 4: Set up notification in PRTG

  • In the PRTG web interface, select Setup | Account Settings | Notification Templates from the main menu.
  • Click the Add Notification Template and select Execute Program.
  • In the Executable File dropdown, select Mimcmd.exe
  • In the Parameters field, enter message <ICQ#1> <ICQ#2> "Message" to send Message to the ICQ numbers <ICQ#1> and <ICQ#2>.

    For example, enter the following to send the standard notification of PRTG to ICQ# 12345678: message 12345678 "[%sitename] %device %name %status %down (%message)"
  • Click Save.
  • The new notification template is now shown in the list of notification templates. Click the Send test notification button to send a test message. It should be visible in the recipient's messenger immediately.
  • You can add several notification templates by repeating the actions in this step.
  • Use a sensor's Notification Triggers tab to add a trigger that uses this newly created notification.

Notes

  • Instead of an ICQ number, you can also enter other IDs as recipients, depending on the messenger accounts configured in Miranda. For example, you can send a message to an MSN ID (usually this is an email address). Account types can also be mixed in one call, for example you can send the same message to ICQ and MSN: message 12345678 [email protected] "[%sitename] %device %name %status %down (%message)"
  • Instead of using the messenger account IDs as recipients, you can also use the profile names as shown in the Miranda contact list. The message will then be sent to the first contact matching the name. For example, to send a message to an ICQ account shown as "Paessler" in the Miranda contact list, you would type: message Paessler "[%sitename] %device %name %status %down (%message)"

Known issues

Depending on the used command line tool version, messages might be sent three times (one per minute), although they were only triggered once. This is because the command line tool does not give back an exit code 0. You can work around this by creating a batch file that calls the command line tool with the respective options, then terminates with EXIT 0 In PRTG you directly use the batch file instead of the command line tool then.

Troubleshooting

If you come across a message Could not create connection with Miranda, this indicates an issue in the communication between miranda32.exe and MimCmd.exe (when executed by PRTG). Make sure that the miranda32.exe and PRTG Server.exe services are running under the same Windows user account (usually, this is SYSTEM). This account must have sufficient rights to execute the necessary files. You might need to reconfigure both services so they run on a Windows domain account.

(A "Thank you" goes to Jon DeSalvatore for sending this hint!)

More

Created on Jan 25, 2011 2:33:43 PM by  Daniel Zobel [Product Manager]

Last change on Jan 2, 2023 2:14:14 PM by  Brandy Greger [Paessler Support]



Votes:

0

I have followed this guide and are having problems with it, I am using Windows Server 2012 Standard.

I have checked in TaskManager and made sure that Miranda and PRTG Core are both running as the SYSTEM user.

The error I get from running the Mimcmd.exe is "Error sending "EXE": Error4"

Would anyone have gotten this to work on Windows Server 2012 or have any additional help into getting this setup.

Created on Mar 5, 2013 11:32:41 PM



Votes:

0

I am sorry, but we did not yet test this with Windows Server 2012. Most likely, this is a permissions issue. Please check the permissions of the mimcmd.exe file and make sure the local Windows "SYSTEM" user account has full access rights.

Created on Mar 7, 2013 9:12:43 AM by  Daniel Zobel [Product Manager]



Votes:

2

It is possible to send Telegram messages from PRTG:

This is how we connected Telegram to our PRTG instance.

Install Cygwin64 (https://cygwin.com/)

In the wizard:
Select the whole Dev part
Search for: lua, cygwin32-readline, libreadline-devel, libreadline7, openssl, cygwin32-openssl, libopenssl and select packages you can select install

- execute the following commands:

mkdir /home/install cd /home/install git clone https://github.com/vysheng/tg.git && cd tg ./configure —disable-libconfig make

- add these paths to the windows paths: C:\CYGWIN64\BIN;C:\CYGWIN64\USR\BIN - create the following scripts in /home/install/tg:

File send.expect

#!/usr/bin/expect cd /home/install/tg spawn ./telegram -B expect "User" send "msg $argv\r" expect "Sent:" send "quit\r" expect eof puts "Message has been sent”

File message.sh

#!/bin/bash cd /home/install/tg mkdir -p ~/.telegram cp binlog ~/.telegram/binlog ./send.expect $@

File sendmessage.bat

@echo off "c:\cygwin64\bin\sh.exe" "/home/install/tg/message.sh" %* exit 0

- Install PSTools Suite (http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx)
- Execute CMD as SYSTEM: psexec -i -s cmd.exe
- In the command box, execute: c:\cygwin64\home\install\tg\telegram -B
- Login in Telegram with your number.
- Quit.
- Copy sendmessage.bat to the PRTG installation folder\Notifications\EXE.
- Restart PRTG
- Create a notification with this Batch file. The first parameter must be the name of the group or user were you want to send the message to (spaces are converted to underscores).

Created on Aug 7, 2014 8:53:09 AM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.