How can I make use of the included monit configuration files included with the OPDK?

I've noticed recently that in the 4.17.x OPDK there are monit configuration files included for each component. Does Apigee have any documentation on how to take advantage of these included configuration files.

cat /opt/apigee/edge-message-processor/monit/default.conf

check host edge-message-processor with address localhost restart program = "/opt/apigee/apigee-service/bin/apigee-service edge-message-processor monitrestart" if failed host <ipaddress> port 8998 and protocol http with http headers [X-Apigee.heartbeat: true] and request "/" and status < 600 with timeout 15 seconds for 3 times within 3 cycles then restart if failed host <ipaddress> port 4528 with timeout 15 seconds for 3 times within 3 cycles then restart
Solved Solved
0 12 656
1 ACCEPTED SOLUTION

This is not redundant with anything built into the Private Cloud distribution. The Monit config files are undocumented, but should work fine if you plan to integrate with an existing Monit instance.

View solution in original post

12 REPLIES 12

These are for the BETA monitoring dashboard. The details can be found here : http://docs.apigee.com/private-cloud/latest/monitoring-dashboard-installation

Thanks but this speaks to the monitoring dashboard, not monit specifically. We already have the monitoring dashboard configured which is much different than monit provides.

monit is part of the internal process monitoring used in edge; its open source that we include in our builds

Could you elaborate more on what that means? I don't see any monit executables included with Apigee. How is edge using monit? Reason I ask is currently we have our own monit install and configuration that we use and now wondering if that is redundant to what edge is doing. Do we no longer need our installation of monit or can we take advantage of the edge configuration somehow?

@David Ryan what are you trying to acomplish?

Take a look at this post to see if that addresses your need:

https://community.apigee.com/questions/41230/private-cloud-monitoring-options.html

Some context, we do use the Monitoring Dashboard, which is nice from a metrics and platform view however it's what I would call a passive way of monitoring the platform. Meaning to say, someone would have to sit and stair at the screen all day long to see if routers or mps were up or down.

The main reason we implemented monit is for the capabilities that monit does best, meaning it can take action (i.e. restart a service, alert, etc) when something is wrong. We setup monit based on what we knew at the time about the platform and all has worked pretty well so far.

As I stated in my post I happened to notice that edge now has monit config files included which do have some differences from ours. That led me to ask the initial question which was how is this being used and should we be doing something different with our monit setup.

This is not redundant with anything built into the Private Cloud distribution. The Monit config files are undocumented, but should work fine if you plan to integrate with an existing Monit instance.

@Paul Mibus - So, if I understand correctly, we could use our current implementation of monit and reference the various config files for loading?

I'm curious to know more about the restart command - restart program = "/opt/apigee/apigee-service/bin/apigee-service edge-message-processor monitrestart".

Does this work? I receive the following error and not sure what its looking for or trying to do.

find: failed to restore initial working directory: Permission denied

You're probably running it from a directory such as /root which the apigee user doesn't have access to. Try running it from a globally accessible directory like /opt/apigee and the error should go away.

The script is at /opt/apigee/edge-<component>/lib/actions/monitrestart if you want to see the nuts and bolts of what it's doing.

That worked, thanks.

Do you know if it disables monit monitoring while the service is restarting so it doesn't get into a loop? We encountered that and had to write a wrapper script around the apigee-service commands

I'm not sure whether it does that, but reading the monit default.conf file indicates that monit itself is using the monitrestart service action, so my assumption is that the restart will be handled correctly without looping.