With Monyog installed on your server, you can begin to configure systems and databases in your infrastructure for its use. In order to use Monyog to monitor a server, you need only grant its user access to the MySQL and then register the server through the Web UI.
When you register a server with Monyog, it collects information and monitors the server's health through standard MySQL client connections. In order for Monyog to access this data, you need to configure a user account with the appropriate permissions on each MySQL server you want to monitor. Fully enabling Monyog requires that you grant
SUPER to this user. You can use whatever user name you find convenient, with the host set to the server hosting Monyog.
For instance, say you have installed Monyog on a server at 192.168.1.150 and that you would like use the user
monyog as the user name. To fully enable Monyog in this scenario, you would issue the following command:
GRANT SELECT, RELOAD, PROCESS, SUPER ON *.* TO 'monyog'@'192.168.1.150';
Granting these permissions makes the MySQL server fully accessible to Monyog. To actually start collecting data on this server you also need to register it with the application. For more information on how to do this, see Server Registration.
Running Monyog as unprivileged user
By default, Monyog runs under the 'root' account in Linux. This may be a security nightmare for some.
Here's how you can create and use a user account exclusively for running Monyog:
- First add a new user and group; replace <GID>, with the group ID, and <PASSWORD>:
# groupadd monyog
# useradd -g <GID> -p <passwd> monyog
- Copy the original files to the new location and change the file ownership.
# cp -r /usr/local/MONyog/. /home/monyog/
# chown -R monyog:monyog /home/monyog
- Next, we need to change the initialization script. Be sure to make a backup first!
# cp /etc/init.d/MONyogd /etc/init.d/MONyogd.orig
# vi /etc/init.d/MONyogd
- Change the following lines for the new path.
- In the same file, you also need to update the start command to the following.
# Start MONyog. ... else action "`su - monyog -c \"$MONYOGBIN -s\"`" /bin/true fi
- Now you need to alter the configuration file.
# vi /home/monyog/MONyog.ini
- Change the data path to the new directory.
- After this you should be able to start Monyog running as an unprivileged user.
# service MONyog start