Hi, yes, monit requires pidfile ... you can still watch the parent process of smbd childs - the 'totalcpu' and 'totalmem' allows to react to total cpu and memory usage of all smbd's sub-processes, the 'children' statement allows to check sub-processes count.
Example: check process smbd with pidfile /opt/samba/var/locks/smbd.pid start program = "/etc/init.d/smbd start" stop program = "/etc/init.d/smbd stop" if failed host 192.168.1.1 port 139 type TCP then restart if totalcpu > 80% for 5 cycles then restart if totalmem > 500 MB then restart if children > 50 then restart Regards, Martin On Mar 11, 2010, at 4:35 AM, Adam Nielsen wrote: > Hi all, > > Perhaps I'm not looking in the right spot but as far as I can tell Monit > requires a pidfile in order to monitor a process. > > I'm a bit stuck as to how to apply this to Samba. I don't want to monitor > the main Samba process, but I do want to monitor each process that gets > spawned every time someone connects. If there are 50 users connected to the > machine, there will be ~51 copies of smbd running, and they are created more > or less at random so there is no way to put them in a pidfile. > > After these sub-processes have exceeded a certain amount of memory I want to > kill them (the Windows machine will immediately reconnect so this isn't a > problem) but I'm not sure how to tell monit to check all the processes that > match the name "smbd". > > Any suggestions? > > Many thanks, > Adam. > > > > -- > To unsubscribe: > http://lists.nongnu.org/mailman/listinfo/monit-general -- To unsubscribe: http://lists.nongnu.org/mailman/listinfo/monit-general
