monitor service

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

monitor service

Anders Yuran
Hello!
This is absolutely new for me so all possible help is needed.
I have monit 5.25.1 installed on Ubuntu 18.04
It monitor apache2 and mariadb but I also have a backend server installed for gps tracking. Can I monitor that also?
The traccar.service file looks like this


[Unit]
Description=traccar
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/traccar
ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml
SyslogIdentifier=traccar
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

--
Kind Regards

Anders Yuran

Havouza 15
4607 Pissouri
Cyprus
Reply | Threaded
Open this post in threaded view
|

Re: monitor service

martinp@tildeslash.com
Yes, something like this should work:

        check process traccar match "<pattern>"
                start program = "/bin/systemctl start traccar"
                stop program = "/bin/systemctl stop traccar"

You just need to replace the "<pattern"> by string that will match your process ... you can test it with "monit procmatch <pattern>"


Best regards,
Martin


> On 7 Jul 2020, at 08:31, Anders Yuran <[hidden email]> wrote:
>
> Hello!
> This is absolutely new for me so all possible help is needed.
> I have monit 5.25.1 installed on Ubuntu 18.04
> It monitor apache2 and mariadb but I also have a backend server installed for gps tracking. Can I monitor that also?
> The traccar.service file looks like this
>
>
> [Unit]
> Description=traccar
> After=network.target
>
> [Service]
> Type=simple
> WorkingDirectory=/opt/traccar
> ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml
> SyslogIdentifier=traccar
> SuccessExitStatus=143
>
> [Install]
> WantedBy=multi-user.target
>
> --
> Kind Regards
>
> Anders Yuran
>
> Havouza 15
> 4607 Pissouri
> Cyprus