You can access the API by passing parameters to Monyog through its base URL.

For example, if Monyog is running on a system with IP, then the parameters need to be passed to:

You can use either of the HTTP methods GET and POST.

The Parameters

The parameters that you will need to pass are:

API's for server management

To manage servers in Monyog via API, the following parameters need to be passed:

For example, to add a server:

$ curl "

Additional parameters for registering servers are listed here.

For example, suppose you have a server named Production001 registered with Monyog. To stop data collection for this server using the HTTP GET method, the URL would look like:

$ curl “

In summary, the various URLs that you can use with curl:

Change LDAP bind user password:

$ curl "<sqldm user name>&_password=<sqldm user password>&_currentpassword=<current ldap user password>&_newpassword=<new ldap user password>"

Change user password:

$ curl "<sqldm username>&_password=<currentpassword>&_newpassword=<newpassword>"

Starts data collection for <server name>

$ curl "

Starts data collection for <multiples servers>

$ curl "

Stops data collection for <server name>(Slave Of Production)

$ curl "

Starts data collection for <tag>

$ curl "

Stops data collection for <tag>

$ curl "

Stops data collection globally for all the servers (Maintenance)

$ curl “" 

Enables alerts for <server name>

$ curl "

Disables alerts for <server name>

$ curl "

Enables alerts for <tag>

$ curl "

Disables alerts for <tag>

$ curl "

Disables alerts globally for all the servers(Maintenance)

$ curl "" 

Enables alerts globally for all the servers(Maintenance)

$ curl "" 

Enables Sniffer for <server name>

$ curl "

Disables Sniffer for <server name>

$ curl "

Add Server

$ curl "

Add Server with SSH Tunnel

$ curl "

Edit Server

$ curl "

Delete Server

$ curl ""

Delete all the servers under <tag>

curl "”

Delete multiple servers

curl ",Server2”

Return Codes

Assuming that the connection to SQL DM for MySQL was successful, it returns a text message. The message is in the JSON format:

{“STATUS”: “SUCCESS/FAILURE”, “RESPONSE” : “<Response text>”}

Your application can parse this message and determine whether the operation was successfully carried out or not.

Since version 5.21 we have deprecated the API calls to _object=ConnectionMgr. Instead use _object=MONyogAPI.


The Monyog API is very flexible and can be accessed from other programming languages including scripting languages such as Perl, VBScript, etc. Here is a very generic Perl script that accepts the required parameters from the command line and executes the specified action:

#! /usr/bin/perl
use LWP 5.64;
# USAGE: <hostname>:<port> <user> <password> <connection_name/ID> <action> <value>
# $ARGV[0] = hostname:port of server running Monyog
# $ARGV[1] = Monyog user
# $ARGV[2] = Monyog password
# $ARGV[3] = connection name
# $ARGV[4] = action
# $ARGV[5] = value
my $numArgs = $#ARGV + 1;
if($numArgs < 5) {
   die 'USAGE: <hostname>:<port> <user> <password> <connection_name/ID> <action>';

my $browser = LWP::UserAgent->new;

# The request URL
my $url = URI->new('http://' . $ARGV[0] . '/');

# The form data pairs:
   '_object' => 'MONyogAPI',
   '_action' => $ARGV[4],
   '_user' => $ARGV[1]
   '_password' => $ARGV[2],
   '_server' => $ARGV[3],
   '_value' => $ARGV[5]

# The response object
$response = $browser->post($url);

if (!$response->is_success) {# Error connecting to MONyog
   die $response->status_line . "\n";
} else { 

   # Successfully connected to MONyog; print MONyog's response
   print $response->content . "\n";


| | | | | | |