Monitoring 3CX VoIP services

Hi there,

I’m trying to figure out the best way to monitor a bunch of 3CX services on the CheckMK Raw Edition.

These services status actually appears from the 3CX interface like this :

Their status are also available through a shell command called “3CXServiceControl”.
But this command also returns many other informations, not only the services status.

I’d be delightful if you have an idea on how to proceed via checks or anything so I can pull up the information on the checkmk server.

Thanks,

Jonathan

Are you able to provide an example output from 3CXServiceControl?

Hello Jonathan, welcome to the forum!

Not exactly what you’re asking, but easy to implement out-of-the-box:

As a simple first check, you could monitor the processes on the OS level (WATO: “State and count of processes”), either using process discovery or defining the checks statically.

A dedicated check for 3CX services would surely be nice, but requires more work (e.g. writing a check plugin that parses the output from 3CXServiceControl).

Doing a quick grep on a 3CX system (on Debian), I have at least the following running processes that should propbably be monitored:

/usr/lib/3cxpbx/3CXCallFlow
/usr/lib/3cxpbx/3CXManagementConsole
/usr/lib/3cxpbx/3cxSystemService
/usr/lib/3cxpbx/CloudServicesWatcher
/usr/lib/3cxpbx/TcxQMsrv
/usr/sbin/3CXAudioProvider
/usr/sbin/3CXIVR
/usr/sbin/3CXMediaServer
/usr/sbin/3CXPhoneSystem
/usr/sbin/3CXSLDBServ
/usr/sbin/3CXTunnel

Cheers
Martin

Here is an example output from 3CXServiceControl (made with Putty) :

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2020.06.17 10:53:00 =~=~=~=~=~=~=~=~=~=~=~=
3CXServiceControl
e[?1he=
e[0;4mUNIT LOAD ACTIVE SUB DESCRIPTION e[0me[m
e[0;4mproc-sys-fs-binfmt_misc.automount loaded active running Arbitrary Executable File Fore[m
sys-devices-pci0000:00-0000:00:07.1-ata2-host2-target2:0:0-2:0:0:0-block-sr0.device loaded active plugged VMware_Virtual_IDE_CDROM_Drive[m
sys-devices-pci0000:00-0000:00:15.0-0000:03:00.0-host0-target0:0:0-0:0:0:0-block-sda-sda1.device loaded active plugged Virtual_disk 1 e[m
sys-devices-pci0000:00-0000:00:15.0-0000:03:00.0-host0-target0:0:0-0:0:0:0-block-sda.device loaded active plugged Virtual_disk e[m
sys-devices-pci0000:00-0000:00:16.0-0000:0b:00.0-net-ens192.device loaded active plugged VMXNET3 Ethernet Controller e[m
sys-devices-platform-floppy.0-block-fd0.device loaded active plugged /sys/devices/platform/floppy.e[m
sys-devices-platform-serial8250-tty-ttyS0.device loaded active plugged /sys/devices/platform/serial8e[m
sys-devices-platform-serial8250-tty-ttyS1.device loaded active plugged /sys/devices/platform/serial8e[m
sys-devices-platform-serial8250-tty-ttyS2.device loaded active plugged /sys/devices/platform/serial8e[m
sys-devices-platform-serial8250-tty-ttyS3.device loaded active plugged /sys/devices/platform/serial8e[m
sys-devices-virtual-block-dm\x2d0.device loaded active plugged /sys/devices/virtual/block/dme[m
sys-devices-virtual-block-dm\x2d1.device loaded active plugged /sys/devices/virtual/block/dme[m
sys-devices-virtual-block-dm\x2d2.device loaded active plugged /sys/devices/virtual/block/dme[m
sys-devices-virtual-block-dm\x2d3.device loaded active plugged /sys/devices/virtual/block/dme[m
sys-devices-virtual-block-dm\x2d4.device loaded active plugged /sys/devices/virtual/block/dme[m
sys-devices-virtual-block-dm\x2d5.device loaded active plugged /sys/devices/virtual/block/dme[m
sys-devices-virtual-block-dm\x2d6.device loaded active plugged /sys/devices/virtual/block/dme[m
sys-devices-virtual-block-dm\x2d7.device loaded active plugged /sys/devices/virtual/block/dme[m
sys-devices-virtual-misc-rfkill.device loaded active plugged /sys/devices/virtual/misc/rfke[m
e[0;4msys-subsystem-net-devices-ens192.device loaded active plugged VMXNET3 Ethernet Controller e[0me[m
-.mount loaded active mounted Root Mount e[m
boot.mount loaded active mounted /boot e[m
dev-hugepages.mount loaded active mounted Huge Pages File System e[m
dev-mqueue.mount loaded active mounted POSIX Message Queue File Syste[m
home.mount loaded active mounted /home e[m
opt.mount loaded active mounted /opt e[m
proc-sys-fs-binfmt_misc.mount loaded active mounted Arbitrary Executable File Fore[m
run-user-1000.mount loaded active mounted /run/user/1000 e[m
sys-kernel-debug-tracing.mount loaded active mounted /sys/kernel/debug/tracing e[m
sys-kernel-debug.mount loaded active mounted Debug File System e[m
tmp.mount loaded active mounted /tmp e[m
usr.mount loaded active mounted /usr e[m
e[0;4mvar.mount loaded active mounted /var e[0me[m
systemd-ask-password-console.path loaded active waiting Dispatch Password Requests toe[m
e[0;4msystemd-ask-password-wall.path loaded active waiting Forward Password Requests to e[m
init.scope loaded active running System and Service Manager e[m
e[0;4msession-21805.scope loaded active running Session 21805 of user notguese[m
3CXAudioProvider01.service loaded active running 3CX PhoneSystem 01 Audio Prove[m
3CXCallFlow01.service loaded active running 3CX PhoneSystem 01 CallFlow Se[m
3CXCfgServ01.service loaded active running 3CX PhoneSystem Configuratione[m
3CXEventNotificationManager.service loaded active running 3CX Event Notification Managee[m
3CXIVR01.service loaded active running 3CX PhoneSystem 01 IVR Servere[m
3CXMediaServer.service loaded active running 3CX PhoneSystem Media Server e[m
3CXPhoneSystem01.service loaded active running 3CX PhoneSystem 01 SIP Servere[m
3CXPhoneSystemMC01.service loaded active running 3CX PhoneSystem 01 Managemente[m
e[7mlines 1-46e[27me[K
e[K3CXQueueManager01.service loaded active running 3CX PhoneSystem 01 Queue Manae[m
3CXSystemService01.service loaded active running 3CX PhoneSystem 01 System Sere[m
3CXTunnel01.service loaded active running 3CX PhoneSystem 01 SIP/RTP Tue[m
auditd.service loaded active running Security Auditing Service e[m
bd.service loaded active running BitDefender Endpoint Securitye[m
console-setup.service loaded active exited Set console font and keymap e[m
cron.service loaded active running Regular background program pre[m
dbus.service loaded active running D-Bus System Message Bus e[m
dphys-swapfile.service loaded active exited LSB: Autogenerate and use a se[m
getty@tty1.service loaded active running Getty on tty1 e[m
irqbalance.service loaded active running irqbalance daemon e[m
keyboard-setup.service loaded active exited Set the console keyboard layoe[m
kmod-static-nodes.service loaded active exited Create list of required statie[m
lvm2-lvmetad.service loaded active running LVM2 metadata daemon e[m
lvm2-monitor.service loaded active exited Monitoring of LVM2 mirrors, se[m
netfilter-persistent.service loaded active exited netfilter persistent configure[m
networking.service loaded active exited Raise network interfaces e[m
nginx.service loaded active running A high performance web servere[m
ntp.service loaded active running LSB: Start NTP daemon e[m
postfix.service loaded active exited Postfix Mail Transport Agent e[m
postfix@-.service loaded active running Postfix Mail Transport Agent e[m
postgresql.service loaded active exited PostgreSQL RDBMS e[m
postgresql@9.6-main.service loaded active running PostgreSQL Cluster 9.6-main e[m
rc-local.service loaded active exited /etc/rc.local Compatibility e[m
rsyslog.service loaded active running System Logging Service e[m
snmpd.service loaded active running Simple Network Management Proe[m
ssh.service loaded active running OpenBSD Secure Shell server e[m
sysstat.service loaded active exited LSB: Start/stop sysstat’s sade[m
systemd-fsck@dev-mapper-system\x2dboot.service loaded active exited File System Check on /dev/mape[m
systemd-fsck@dev-mapper-system\x2dopt.service loaded active exited File System Check on /dev/mape[m
systemd-journal-flush.service loaded active exited Flush Journal to Persistent Se[m
systemd-journald.service loaded active running Journal Service e[m
systemd-logind.service loaded active running Login Service e[m
systemd-modules-load.service loaded active exited Load Kernel Modules e[m
systemd-random-seed.service loaded active exited Load/Save Random Seed e[m
systemd-remount-fs.service loaded active exited Remount Root and Kernel File e[m
systemd-sysctl.service loaded active exited Apply Kernel Variables e[m
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes ine[m
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Dire[m
systemd-udev-trigger.service loaded active exited udev Coldplug all Devices e[m
systemd-udevd.service loaded active running udev Kernel Device Manager e[m
systemd-update-utmp.service loaded active exited Update UTMP about System Boote[m
systemd-user-sessions.service loaded active exited Permit User Sessions e[m
unattended-upgrades.service loaded active exited Unattended Upgrades Shutdown e[m
user@1000.service loaded active running User Manager for UID 1000 e[m
e[0;4mvmware-tools.service loaded active running LSB: VMware Tools service e[0me[m
e[7mlines 47-92e[27me[K
e[K-.slice loaded active active Root Slice e[m
system-check_mk.slice loaded active active system-check_mk.slice e[m
system-getty.slice loaded active active system-getty.slice e[m
system-postfix.slice loaded active active system-postfix.slice e[m
system-postgresql.slice loaded active active system-postgresql.slice e[m
system-systemd\x2dfsck.slice loaded active active system-systemd\x2dfsck.slice e[m
system.slice loaded active active System Slice e[m
user-1000.slice loaded active active User Slice of notguest e[m
e[0;4muser.slice loaded active active User and Session Slice e[0me[m
check_mk.socket loaded active listening Check_MK Agent Socket e[m
dbus.socket loaded active running D-Bus System Message Bus Socke[m
dm-event.socket loaded active listening Device-mapper event daemon FIe[m
lvm2-lvmetad.socket loaded active running LVM2 metadata daemon socket e[m
lvm2-lvmpolld.socket loaded active listening LVM2 poll daemon socket e[m
syslog.socket loaded active running Syslog Socket e[m
systemd-fsckd.socket loaded active listening fsck to fsckd communication Se[m
systemd-initctl.socket loaded active listening /dev/initctl Compatibility Nae[m
systemd-journald-audit.socket loaded active running Journal Audit Socket e[m
systemd-journald-dev-log.socket loaded active running Journal Socket (/dev/log) e[m
systemd-journald.socket loaded active running Journal Socket e[m
systemd-rfkill.socket loaded active listening Load/Save RF Kill Switch State[m
systemd-udevd-control.socket loaded active running udev Control Socket e[m
e[0;4msystemd-udevd-kernel.socket loaded active running udev Kernel Socket e[0me[m
dev-mapper-system\x2dswap.swap loaded active active /dev/mapper/system-swap e[m
e[0;4mvar-swap.swap loaded active active /var/swap e[0me[m
basic.target loaded active active Basic System e[m
cryptsetup.target loaded active active Encrypted Volumes e[m
getty.target loaded active active Login Prompts e[m
graphical.target loaded active active Graphical Interface e[m
local-fs-pre.target loaded active active Local File Systems (Pre) e[m
local-fs.target loaded active active Local File Systems e[m
multi-user.target loaded active active Multi-User System e[m
network-online.target loaded active active Network is Online e[m
network-pre.target loaded active active Network (Pre) e[m
network.target loaded active active Network e[m
paths.target loaded active active Paths e[m
remote-fs.target loaded active active Remote File Systems e[m
slices.target loaded active active Slices e[m
sockets.target loaded active active Sockets e[m
swap.target loaded active active Swap e[m
sysinit.target loaded active active System Initialization e[m
time-sync.target loaded active active System Time Synchronized e[m
e[0;4mtimers.target loaded active active Timers e[0me[m
apt-daily-upgrade.timer loaded active waiting Daily apt upgrade and clean ae[m
apt-daily.timer loaded active waiting Daily apt download activitiese[m
systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Die[m
e[7mlines 93-138e[27me[K
e[Ke[m
LOAD = Reflects whether the unit definition was properly loaded.e[m
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.e[m
SUB = The low-level unit activation state, values depend on unit type.e[m
e[m
e[0;1;39m137 loaded units listed.e[0m Pass --all to see loaded but inactive units, too.e[m
To show all installed unit files use ‘systemctl list-unit-files’.e[m
e[7mlines 100-145/145 (END)e[27me[K
e[Ka
e[Ke[7mlines 100-145/145 (END)e[27me[K
e[Ka
e[Ke[7mlines 100-145/145 (END)e[27me[K
e[Ka
e[Ke[7mlines 100-145/145 (END)e[27me[Ka
e[Ke[?1le>

/usr/sbin/3CXServiceControl is a minimal shell script that essentially just displays systemd service status (/bin/systemctl $@). So IMO there’s not much to gain here from using 3CXServiceControl.

Instead you should probably monitor

  • all relevant processes (static or discovered)
  • the PostgreSQL database (see the catalog of PostgreSQL check plugins)
  • Systemd Services Summary, optionally Systemd Single Services in addition (again static or discovered)

Hello Martin, thanks for your reply!

I’ve tried using the process discovery.

Is it possible to get all these process with a single process discovery (for example with a regular expression or w.e)? Or do I need to create a process discovery by 3CX Services (which i would like to avoid)?

I’m going to check the “State and count of processes”. Don’t know how to use that one yet.

Also let you know i’ve provided an example output of 3CXServiceControl to rawiriblundell.

If anyone is able to work on a plugin for 3CX that would be awesome as I also need trunk states and number of communications. :slight_smile: (maybe via SNMP?)

Regards,

Jonathan

OK then I will monitor all of these, I was hoping for a more automatised way :stuck_out_tongue:

Thank you for your time.

Monitoring PostgreSQL is already automated quite nicely. At least in a simple setup on Debian, you just deploy the mk_postgres agent plugin and a number of new services should be discovered for that host.

For more monitoring insight into the 3cx applications, they would need to provide some interface to query their internal status, via API, SNMP, … I don’t know if 3cx currently offers such a feature.

I’ve seen a snmp service on 3CX interface. There must be something possible to do.
I’ll open a ticket via 3CX Support.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.