No - as mentioned it's not possible to share the test configuration this way.
The group can be used to start/stop/restart/monitor/unmonitor it via the CLI: monit -g db unmonitor On Sep 12, 2012, at 3:53 PM, Horatiu Nimigean <[email protected]> wrote: > hello, thank you for the reply, however i'm not sure i follow > so i can do this, for example : > check host h1 with addr 1.2.3.4 > group db > check host h2 with addr 1.2.3.5 > group db > check host h3 with addr 1.2.3.6 > group db > > and then for monitoring ssh i could > check group db > if failed port 22 type ssh ... > ? > > what i'm aiming for is a configuration file that is easier to parse for > humans :)) > > On 09/12/2012 04:34 PM, Martin Pala wrote: >> Hello, >> >> you can group the service using the existing "group" statement, such as this: >> >> --8<-- >> check host my1 with address 1.2.3.4 >> if failed ... >> group database >> >> check host my2 with address 1.2.3.5 >> if failed ... >> group database >> --8<-- >> >> You can then use the group to trigger some action on all services, which are >> member of that group. The service can be member of multiple groups by adding >> one option for each group. >> >> The groups however cannot be used to share the configuration. For such >> purpose it'll be probably best to use some configuration template and >> generate the configuration dynamically. >> >> Regards, >> Martin >> >> >> >> On Sep 12, 2012, at 1:26 PM, Horatiu Nimigean <[email protected]> >> wrote: >> >>> Hello. >>> I want to monitor several hosts using monit, nothing too fancy just icmp >>> ping, ssh and smtp for now >>> i have set up monit on a centos 6.3 x86_64, installed from rpmforge, >>>> [root@mon01 monit.d]# monit -V >>>> This is Monit version 5.4 >>> so, i want to monitor a couple (at present 8 hosts) using icmp ping >>> something like >>>> check host db1 with address x.x.x.x >>>> if failed icmp type echo count 3 with timeout 3 seconds then alert >>> but on some of them i also monitor ssh and smtp >>>> if failed port 22 protocol ssh with timeout 15 seconds then alert >>>> if failed port 25 protocol smtp with timeout 15 seconds then alert >>> >>> the question is, (as i've come to realise the config file is getting harder >>> to parse by human eye) >>> is there a way to group the hosts together and check the groups themselves ? >>> like >>> group databases >>> host db1 with address x x >>> host db2 with address x y >>> host db3 [...] >>> group mailservers >>> host mail1 with addr [...] >>> then do a >>> check databases >>> if failed port 3306 protocol mysql [...] >>> etc. >>> >>> >>> also, on the web interface, there are several -sections- >>> at the moment just System and Host >>> and under host i can see my hosts on the left and the prototocols checked >>> on the right. >>> Host: >>> Host1.... online with all services.... [ICMP echo request] | [SSH] at port >>> 22 >>> etc >>> is there a way to divide theese sections in the way of >>> ICMP monitored hosts: >>> Host1 .... Online with all services ..... [ICMP Echo request] >>> Host2 .... etc >>> then >>> SSH status on hosts >>> Host1 ..... Online with all services ..... [SSH] at port 22 >>> etc. >>> >>> thanks :) >>> -- >>> To unsubscribe: >>> https://lists.nongnu.org/mailman/listinfo/monit-general >> >> >> >> -- >> To unsubscribe: >> https://lists.nongnu.org/mailman/listinfo/monit-general > > -- > To unsubscribe: > https://lists.nongnu.org/mailman/listinfo/monit-general
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general
