Normally somebody would google and follow the instructions in the following article in the NetXMS Documentation. However… it wasn’t accurate enough for me, that finally made me to write this post.
As a device, I used an old Nokia mobile phone. Any phone with modem function would do the job anyway. NetXMS is initializing it with standard AT commands.
Step 1: Open a root shell on your server (local console or ssh – doesn’t matter).
Step 2: You need to tail your /var/log/syslog or /var/log/messages (it depends on the Unix-Like operating system you are using – Linux distribution or BSD derivate).
# tail -f /var/log/messages
Step 3: Plug the phone via USB (or serial) cable to your NetXMS server machine. Note that if the phone asks, you should connect the device as a modem. Take a look at the console output. It should inform you, that a device has been plugged in and it shows you the /dev/ttySXX node, which has been assigned to it (in case you have connected the phone via USB). Write it down. In case of connecting your phone with a serial cable, you would actualy not see any output, so you probably would use the /dev/ttySXX node of the port you have connected it. In my case it was /dev/ttyACM0
Step 4: Set the right configuration parameters in NetXMS, so it can use your phone. The problem I had with the NetXMS documentation was, that it wasn’t clear enough where to set the variables SMSDriver and SMSDrvConfig. Personally, I was struggling with it a half day. The location you can find the variables is in the NetXMS console under the context menu Configuration -> Server Configuration.
Replace /dev/ttyACM0 with the /dev node you have found out over your log messages. The rest is pretty accurate for every mobile phone.
That should do the job. Now try to send yourself a test message over Tools -> Send SMS.
After succesful testing, you should configure your actions (it is pretty similar like email message notification) and add them to your event processing policies. Dont add many numbers per action, instead create an action for every separate phone number you want to notify. This is, because NetXMS is somehow to fast for the phone’s modem, so it will fail to send to everyone.
The last thing you should care of, is that you need to add a dot (.) at the end of your formatted message, because on some phones the message string gets cut.