How to monit mariadb

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How to monit mariadb

Tino Hendricks
Dear list,

I upgraded one (gentoo) server  from mysql-5.7.24 to mariadb-10.1.37 and since then I’m not able to check it's running.

monit 5.25.3 Config is unchanged:
check process mysqld with pidfile /run/mysqld/mysql.pid
        group database
        start program = "/etc/init.d/mysql restart" with timeout 30 seconds
        stop program = "/etc/init.d/mysql stop"
        if failed host localhost port 3306 protocol mysql for 3 times within 5 cycles then alert
        if cpu > 7% for 2 cycles then alert


Port is open:
~ # netstat -ln | grep 3306
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN

Process is running:
 ~ # ps aux | grep mysql
mysql    11281  1.6  0.1 2610924 456172 ?      Ssl  12:53   9:25 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf
root     14224  0.0  0.0  11192   968 pts/3    S+   22:37   0:00 grep --colour=auto mysql

I am out of ideas and grateful for a little hint.

Thanks

Tino
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: How to monit mariadb

Paul Theodoropoulos
Hi Tino,

You didn't provide any details on how specifically it is failing. Does monit say it's not running, or does monit ignore the status and always thinks it's running whether it is or not? Is the PID saved in the same subdirectory of /run/?

On 3/20/19 14:39, Tino Hendricks wrote:
Dear list,

I upgraded one (gentoo) server  from mysql-5.7.24 to mariadb-10.1.37 and since then I’m not able to check it's running.

monit 5.25.3 Config is unchanged:
check process mysqld with pidfile /run/mysqld/mysql.pid
        group database
        start program = "/etc/init.d/mysql restart" with timeout 30 seconds
        stop program = "/etc/init.d/mysql stop"
        if failed host localhost port 3306 protocol mysql for 3 times within 5 cycles then alert
	if cpu > 7% for 2 cycles then alert


Port is open:
~ # netstat -ln | grep 3306
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN

Process is running:
 ~ # ps aux | grep mysql
mysql    11281  1.6  0.1 2610924 456172 ?      Ssl  12:53   9:25 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf
root     14224  0.0  0.0  11192   968 pts/3    S+   22:37   0:00 grep --colour=auto mysql

I am out of ideas and grateful for a little hint.

Thanks

Tino

-- 
Paul Theodoropoulos
www.anastrophe.com

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: How to monit mariadb

Szépe Viktor
In reply to this post by Tino Hendricks
Idézem/Quoting Tino Hendricks <[hidden email]>:

> Dear list,
>
> I upgraded one (gentoo) server  from mysql-5.7.24 to mariadb-10.1.37  
> and since then I’m not able to check it's running.
>
> monit 5.25.3 Config is unchanged:
> check process mysqld with pidfile /run/mysqld/mysql.pid
>         group database
>         start program = "/etc/init.d/mysql restart" with timeout 30 seconds
>         stop program = "/etc/init.d/mysql stop"
>         if failed host localhost port 3306 protocol mysql for 3  
> times within 5 cycles then alert
> if cpu > 7% for 2 cycles then alert
>
>
> Port is open:
> ~ # netstat -ln | grep 3306
> tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN
>
> Process is running:
>  ~ # ps aux | grep mysql
> mysql    11281  1.6  0.1 2610924 456172 ?      Ssl  12:53   9:25  
> /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf
> root     14224  0.0  0.0  11192   968 pts/3    S+   22:37   0:00  
> grep --colour=auto mysql
>
> I am out of ideas and grateful for a little hint.

Maybe you've just missed to mention what is the problem. Is there an  
error message in Monit's log?

ps. instead of directly calling the init script try to use your init  
system's command, SysVinit's is /usr/sbin/service


SZÉPE Viktor, webes alkalmazás üzemeltetés / Running your application
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
~~~
ügyelet/hotline: +36-20-4242498  [hidden email]  skype: szepe.viktor
Budapest, III. kerület






--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: How to monit mariadb

Tino Hendricks
In reply to this post by Paul Theodoropoulos
Paul, Viktor,

thank you very much for reminding me that I obviously missed the most important part, sorry.

Here’s the log:
[CET Mar 20 22:14:27] info     : ’server' Monit 5.25.3 started
[CET Mar 20 22:14:27] error    : 'mysqld' process is not running
[CET Mar 20 22:14:27] info     : 'mysqld' trying to restart
[CET Mar 20 22:15:28] error    : 'mysqld' process is not running
[CET Mar 20 22:15:28] info     : 'mysqld' trying to restart
[CET Mar 20 22:16:28] error    : 'mysqld' process is not running
[CET Mar 20 22:16:28] info     : 'mysqld' trying to restart
[CET Mar 20 22:17:28] error    : 'mysqld' process is not running
[CET Mar 20 22:17:28] info     : 'mysqld' trying to restart
[CET Mar 20 22:18:16] info     : 'mysqld' unmonitor on user request

And pid-file exists with the same permissions as on the other, still mysql servers:
 ~ # ls -l /run/mysqld/mysqld.pid
-rw-rw---- 1 mysql mysql 6 20. Mär 12:53 /run/mysqld/mysqld.pid

httpd listing (monitoring temporarily disabled):
 Parameter Value
   Name mysqld
   Pid file /run/mysqld/mysql.pid
   Status Not monitored
   Group database
   Monitoring status Not monitored
   Monitoring mode active
   On reboot start
   Data collected Thu, 21 Mar 2019 08:41:18
   Existence If doesn't exist then restart
   Port If failed [127.0.0.1]:3306 type TCP/IP protocol MYSQL with timeout 5 s for 3 times within 5 cycles
   then alert
   CPU usage limit If greater than 7.0% for 2 cycles then alert

Thanks again for thinking about it!

Tino

> Am 20.03.2019 um 22:43 schrieb Paul Theodoropoulos <[hidden email]>:
>
> Hi Tino,
>
> You didn't provide any details on how specifically it is failing. Does monit say it's not running, or does monit ignore the status and always thinks it's running whether it is or not? Is the PID saved in the same subdirectory of /run/?
>
> On 3/20/19 14:39, Tino Hendricks wrote:
>> Dear list,
>>
>> I upgraded one (gentoo) server  from mysql-5.7.24 to mariadb-10.1.37 and since then I’m not able to check it's running.
>>
>> monit 5.25.3 Config is unchanged:
>> check process mysqld with pidfile /run/mysqld/mysql.pid
>>         group database
>>         start program = "/etc/init.d/mysql restart" with timeout 30 seconds
>>         stop program = "/etc/init.d/mysql stop"
>>         if failed host localhost port 3306 protocol mysql for 3 times within 5 cycles then alert
>> if cpu > 7% for 2 cycles then alert
>>
>>
>> Port is open:
>> ~ # netstat -ln | grep 3306
>> tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN
>>
>> Process is running:
>>  ~ # ps aux | grep mysql
>> mysql    11281  1.6  0.1 2610924 456172 ?      Ssl  12:53   9:25 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf
>> root     14224  0.0  0.0  11192   968 pts/3    S+   22:37   0:00 grep --colour=auto mysql
>>
>> I am out of ideas and grateful for a little hint.
>>
>> Thanks
>>
>> Tino
>>
>
> --
> Paul Theodoropoulos
>
> www.anastrophe.com
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: How to monit mariadb

Bernd Wurst
Am 21.03.19 um 08:54 schrieb Tino Hendricks:
> ~ # ls -l /run/mysqld/mysqld.pid
> -rw-rw---- 1 mysql mysql 6 20. Mär 12:53 /run/mysqld/mysqld.pid
>
> httpd listing (monitoring temporarily disabled):
>  Parameter Value
>    Name mysqld
>    Pid file /run/mysqld/mysql.pid


There's a mismatch in the pid file name.



--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: How to monit mariadb

Paul Theodoropoulos
On 3/21/19 03:38, Bernd Wurst wrote:
Am 21.03.19 um 08:54 schrieb Tino Hendricks:
~ # ls -l /run/mysqld/mysqld.pid
-rw-rw---- 1 mysql mysql 6 20. Mär 12:53 /run/mysqld/mysqld.pid

httpd listing (monitoring temporarily disabled):
 Parameter Value
   Name mysqld
   Pid file /run/mysqld/mysql.pid

There's a mismatch in the pid file name.

Totally random observation, but it's one-character changes in things like that, that are responsible for probably ten percent of my gray hairs.
-- 
Paul Theodoropoulos
www.anastrophe.com

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: How to monit mariadb

Szépe Viktor
Idézem/Quoting Paul Theodoropoulos <[hidden email]>:

> On 3/21/19 03:38, Bernd Wurst wrote:
>> Am 21.03.19 um 08:54 schrieb Tino Hendricks:
>>> ~ # ls -l /run/mysqld/mysqld.pid
>>> -rw-rw---- 1 mysql mysql 6 20. Mär 12:53 /run/mysqld/mysqld.pid
>>>
>>> httpd listing (monitoring temporarily disabled):
>>>  Parameter Value
>>>    Name mysqld
>>>    Pid file /run/mysqld/mysql.pid
>>
>> There's a mismatch in the pid file name.
>>
> Totally random observation, but it's one-character changes in things  
> like that, that are responsible for probably ten percent of my gray  
> hairs.

You find well-tested monit service configs in my public repo
https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/services/mysql-server

All the best!



SZÉPE Viktor, webes alkalmazás üzemeltetés / Running your application
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
~~~
ügyelet/hotline: +36-20-4242498  [hidden email]  skype: szepe.viktor
Budapest, III. kerület






--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: How to monit mariadb

Paul Theodoropoulos
On 3/21/19 10:05, SZÉPE Viktor wrote:
Idézem/Quoting Paul Theodoropoulos [hidden email]:

On 3/21/19 03:38, Bernd Wurst wrote:
Am 21.03.19 um 08:54 schrieb Tino Hendricks:
~ # ls -l /run/mysqld/mysqld.pid
-rw-rw---- 1 mysql mysql 6 20. Mär 12:53 /run/mysqld/mysqld.pid

httpd listing (monitoring temporarily disabled):
 Parameter Value
   Name mysqld
   Pid file /run/mysqld/mysql.pid

There's a mismatch in the pid file name.

Totally random observation, but it's one-character changes in things like that, that are responsible for probably ten percent of my gray hairs.

You find well-tested monit service configs in my public repo
https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/services/mysql-server

All the best!
That's a wonderful repo - perhaps Martin might consider adding a link to that in the wiki....

-- 
Paul Theodoropoulos
www.anastrophe.com

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general