Hello Kristian, M/Monit caches the whole host entry including credentials to offload the database - it is possible to set the credentials using SQL directly, but it should be done this way to keep the cache consistent:
1.) stop M/Monit 2.) run sql statements 3.) start M/Monit Note: on stop M/Monit syncs the cache content to database so if you did the sql statement before stopping M/Monit, it will overwrite the entries back to correspond to cache content Best regards, Martin On Jun 23, 2010, at 3:05 PM, Kristian Van Der Vliet wrote: > Hi, > > I've recently re-installed our M/Monit instance on a new host and after our > approximately 250 host re-registered with M/Monit I've found that M/Monit > insists it can not connect to the host: if I select a host on the Status page > I get > > "Cannot connect to Monit -- Invalid username or password > Please check latest events for the host and host configuration." > > O.K, fine, when the host registered itself it naturally left the username & > password blank. Given that I have ~250 hosts and don't fancy configuring the > passwords via. my web browser for each one, I thought it'd be a nice and easy > job to run a quick MySQL query to set the passwords: > > UPDATE `hosts` SET uname="admin",password="<password>"; > > except this didn't work. The correct username and password are now set in the > database, but M/Monit insists it can't connect to the host. If I bite the > bullet and go to the "Edit Host" page, and set the same username and password > there, it'll work. However I can't see what M/Monit does that I haven't > already done via. the SQL query! > > I'm sure I'm missing something here. Are there any additional fields I need > to change or add in the database? Is there some magic incantation I have to > perform to get M/Monit to read the username & password that's already in the > database? > > Yes I could set the username & password manually, but not for ~250 hosts... > > Any help or suggestions would be appreciated. Thanks in advance. > > -- > Kristian Van Der Vliet > > -- > To unsubscribe: > http://lists.nongnu.org/mailman/listinfo/monit-general -- To unsubscribe: http://lists.nongnu.org/mailman/listinfo/monit-general
