Monitoring b27 system status

You are here

Monitoring b27 system status

8 posts / 0 new
Last post
murky
murky's picture
Monitoring b27 system status

Prior to the b27 release, it was possible to check index.jsp for the string "System status is fine'.

Since the new AJAXy interface changes, I cannot find an appropriate path to check the status of the app.

Is there a new method that can be used?

Regards, Rob.

heller
heller's picture

Rob,

it could be found in the menue "Server-State" - but this is only a manual way.

Regards
Heller

murky
murky's picture

OK - I thought as much.

Thanks anyway!

crownedgrouse
crownedgrouse's picture

http://mmonit.com/monit

The best way to monit the process is to watch link between a pidfile and a process... but mec_as2 do not provide a pidfile... So let create it (UNIX only) !

in your start script add before java launch pid file creation from current pid and launch java with a 'exec' (that replace current process by java application) :

echo $$ > $HOME/var/run/mec_as2.pid
exec java ...

So now mec_as2 get the start script pidfile.

at end of stop script add :
\rm -f $HOME/var/run/mec_as2.pid

Then add a monit config
___________________________________________________
check process mec_as2 with pidfile /home/user/var/run/mec_as2.pid
start = "/bin/su - user -c '~/AS2dir/mec_as2_start.sh'"
stop = "/bin/su - user -c '~/AS2dir/mec_as2_stop.sh'"
if 5 restarts within 5 cycles then timeout
___________________________________________________

You may add monit regex filtering of mec_as2 log file
in order to be warned of any problem you want. It implies to know what king of strings must be detected.

Regards

crownedgrouse
crownedgrouse's picture

For web interface, you can also use monit without any manual action. Use below template of monit :

IF FAILED URL ULR-spec
[CONTENT {==|!=} "regular-expression"]
[TIMEOUT number SECONDS] [[] CYCLES]
THEN action
[ELSE IF SUCCEEDED [[] CYCLES] THEN action]

Example :
___________________________________________________
check host FOO with address www.foo.bar
if failed url
http://user:password@www.foo.bar:8080/as2/start
and content != 'AS2 server'
then ...
____________________________________________________
it only allow to see that the web-interface is up and running but it does not allow to see the pop-up for server state.

Heller should provide a way to see server state by a simple HTTP GET on a URL. A XML file sent should better !
Regards

heller
heller's picture

crownedgrouse,

We will provide a HTTP server state page or an XML as response or something like that for next release.

Regards
Heller

crownedgrouse
crownedgrouse's picture

It could be nice to send a whatmon XML file :

https://addons.mozilla.org/en-US/firefox/addon/2680

(why create something already existing ?)

The XML syntax is simple and with this you can watch automatically with monit and visually in firefox with whatmon.

two grouses with one bullet :>)

Regards

crownedgrouse
crownedgrouse's picture

heller,
in fact in 'server state' pop-up there is both state for As2 server and http web interface, so 2 URL with a single status may be better.
Somewhat :
http://user:password@www.foo.bar:8080/as2/status.as2
http://user:password@www.foo.bar:8080/as2/status.http

:>)