Remote Monitoring & Management Help

Register the Linux Monitoring Agent as an auto-start service

To ensure the Linux Monitoring Agent automatically starts with the computer, it must be registered as an auto-start service, otherwise you will have to manually restart the Linux Monitoring Agent after every reboot.

The method used to achieve this depends on the version of the Linux distribution installed on the device, and the supported service management tool.

Please note that the below CLI commands require root or superuser privileges.

SysVinit (chkconfig)

SysVinit uses the chkconfig utility to specify the run level to start the Linux Agent service in.

1. Check the current rmmagent service runlevels (on or off) using chkconfig --list. Include |grep rmmagent to limit the results to the Linux Monitoring Agent service. Auto-start is Runlevel 3.

chkconfig --list rmmagent

# chkconfig --list rmmagent

rmmagent       0:off   1:off  2:off   3:off   4:off   5:off   6:off

(Note: For This output shows SysV services only and does not include native systemd services please follow the systemd steps below)

2. Where runlevel 3 is off, use the -add command to configure the service to automatically restart during a system reboot.

chkconfig --add rmmagent

# chkconfig --add rmmagent

3. Once complete, rerun the --list command to ensure the -add action was successful.

# chkconfig --add rmmagent

# chkconfig --list rmmagent

rmmagent        0:off   1:off   2:on    3:on    4:on    5:on    6:off

Debian Note (chkconfig and update-rc.d)

Not all Debian distributions have the chkconfig installed by default (for example Ubuntu 12.04).

You can either install chkconfig via AptGet then follow the above SysVinit steps:

apt-get install chkconfig

# apt-get install chkconfig

Or use update-rc.d to set the runlevel.

1. Set the service to start with the default runlevel.

update-rc.d rmmagent defaults

2. Query the rc*.d directories to determine whether this was successful (K = Stopped, S = Started)

find /etc/rc*.d/ -name *rmmagent*|grep rc|sort

# update-rc.d rmmagent defaults Adding system startup for /etc/init.d/rmmagent ...

/etc/rc0.d/K20rmmagent -> ../init.d/rmmagent

/etc/rc1.d/K20rmmagent -> ../init.d/rmmagent

/etc/rc6.d/K20rmmagent -> ../init.d/rmmagent

/etc/rc2.d/S20rmmagent -> ../init.d/rmmagent

/etc/rc3.d/S20rmmagent -> ../init.d/rmmagent

/etc/rc4.d/S20rmmagent -> ../init.d/rmmagent

/etc/rc5.d/S20rmmagent -> ../init.d/rmmagent

# find /etc/rc*.d/ -name *rmmagent*|grep rc|sort

/etc/rc0.d/K20rmmagent

/etc/rc1.d/K20rmmagent

/etc/rc2.d/S20rmmagent

/etc/rc3.d/S20rmmagent

/etc/rc4.d/S20rmmagent

/etc/rc5.d/S20rmmagent

/etc/rc6.d/K20rmmagent

Systemd

The systemd suite of tools is responsible for controlling the management of services (started, stopped, behavior after a reboot etc). Systemd was adopted as a replacement for SysVinit in a number of distributions including Centos (17.14.04 +), Debian (8 +), Fedora (15 +), openSUSE (12.2 +), Red Hat Enterprise Linux (12 +), Ubuntu (15.04 +).

1. Check the current rmmagent service runlevels (enable or disable) using systemctl list-unit-files --type=service. Include |grep rmmagent to limit the results to the Linux Monitoring Agent service.

systemctl list-unit-files --type=service | grep rmmagent

systemctl list-unit-files --type=service | grep rmmagent

rmmagent.service disabled

2. Where the service is disabled, use the enable command to automatically restart the service during a system reboot:

systemctl enable rmmagent

# systemctl enable rmmagent 

Created symlink from /etc/systemd/system/multi-user.target.wants/rmmagent.service to /etc/systemd/system/rmmagent.service

3. Once complete, run the status command both before and after a reboot to ensure the enable action was successful

systemctl status rmmagent

# systemctl enable rmmagent

Created symlink from /etc/systemd/system/multi-user.target.wants/rmmagent.service to /etc/systemd/system/rmmagent.service

# systemctl status rmmagent

rmmagent.service - Advanced Monitorng Agent

Loaded: loaded (/etc/systemd/system/rmmagent.service; enabled; vendor preset: disabled)

Active: active (running) since Tue 2017-12-05 16:12:41 GMT; 17 min ago

Process: 1093 ExecStart=/usr/local/rmmagent/rmmagentd -ss (code=exited, status=0/SUCCESS)

Main PID: 1123 (rmmagentd)

CGroup: /system.slice/rmmagent/rmmagentd -ss

1123 /usr/local/rmmagent/rmmagentd -ss

Dec 05 16:12:40 localhost.localdomain systemd[1]: Starting Advacned Monitorin...

Dec 05 16:12:40 localhost.localdomain systemd[1]: Started Advacned Monitoring...

Hint: Some lines were ellipsized, use -l to show in full.

 

Please note that we are not responsible for the content of external sites.