What is the best approach to check log files using "journalctl"?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the best approach to check log files using "journalctl"?

Jorge Pereira
Hi,

  Usually, I use the option 'content' to polling a file looking for the token. what should I use if I am running a system with systemd?

<snip>
check file telegraf_notwrite with path /var/log/mysystem.log
    if content = "MyString" then alert
</snip>

do we have some plans to support some checks using the journalctl?

I mean: journalctl -x -u mysystem.service
--
--
Jorge Pereira

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

Re: What is the best approach to check log files using "journalctl"?

martinp@tildeslash.com
Hi,

you can use "check program" with custom script, that will run journalctl and check content.

Best regards,
Martin

> On 17 Feb 2017, at 00:32, Jorge Pereira <[hidden email]> wrote:
>
> Hi,
>
>   Usually, I use the option 'content' to polling a file looking for the token. what should I use if I am running a system with systemd?
>
> <snip>
> check file telegraf_notwrite with path /var/log/mysystem.log
>     if content = "MyString" then alert
> </snip>
>
> do we have some plans to support some checks using the journalctl?
>
> I mean: journalctl -x -u mysystem.service
> --
> --
> Jorge Pereira
> --
> 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: What is the best approach to check log files using "journalctl"?

Jorge Pereira
yes, But I wondering to know if exist plans to include the internal mechanism to do that avoiding external scripts.

On Fri, Feb 17, 2017 at 9:17 AM, Martin Pala <[hidden email]> wrote:
Hi,

you can use "check program" with custom script, that will run journalctl and check content.

Best regards,
Martin

> On 17 Feb 2017, at 00:32, Jorge Pereira <[hidden email]> wrote:
>
> Hi,
>
>   Usually, I use the option 'content' to polling a file looking for the token. what should I use if I am running a system with systemd?
>
> <snip>
> check file telegraf_notwrite with path /var/log/mysystem.log
>     if content = "MyString" then alert
> </snip>
>
> do we have some plans to support some checks using the journalctl?
>
> I mean: journalctl -x -u mysystem.service
> --
> --
> Jorge Pereira
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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



--
--
Jorge Pereira

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

Re: What is the best approach to check log files using "journalctl"?

martinp@tildeslash.com
No, at this point we don't have this on our list.

I see it could be useful to observe systemd logs, there seems to be also sd-journal.h API, which may allow programatic access to logs, so it can be maybe added in the future. 


On 17 Feb 2017, at 16:13, Jorge Pereira <[hidden email]> wrote:

yes, But I wondering to know if exist plans to include the internal mechanism to do that avoiding external scripts.

On Fri, Feb 17, 2017 at 9:17 AM, Martin Pala <[hidden email]> wrote:
Hi,

you can use "check program" with custom script, that will run journalctl and check content.

Best regards,
Martin

> On 17 Feb 2017, at 00:32, Jorge Pereira <[hidden email]> wrote:
>
> Hi,
>
>   Usually, I use the option 'content' to polling a file looking for the token. what should I use if I am running a system with systemd?
>
> <snip>
> check file telegraf_notwrite with path /var/log/mysystem.log
>     if content = "MyString" then alert
> </snip>
>
> do we have some plans to support some checks using the journalctl?
>
> I mean: journalctl -x -u mysystem.service
> --
> --
> Jorge Pereira
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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



--
--
Jorge Pereira
--
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: What is the best approach to check log files using "journalctl"?

Jorge Pereira
Martin,

  I would like to work on it. but, I am not sure about your policies to receive external patches. at first, do you have some advice to init the contribution to monit (agent) project? I am always trying to improve/help others OSS projects github.com/jpereira/

On Fri, Feb 17, 2017 at 1:27 PM, Martin Pala <[hidden email]> wrote:
No, at this point we don't have this on our list.

I see it could be useful to observe systemd logs, there seems to be also sd-journal.h API, which may allow programatic access to logs, so it can be maybe added in the future. 


On 17 Feb 2017, at 16:13, Jorge Pereira <[hidden email]> wrote:

yes, But I wondering to know if exist plans to include the internal mechanism to do that avoiding external scripts.

On Fri, Feb 17, 2017 at 9:17 AM, Martin Pala <[hidden email]> wrote:
Hi,

you can use "check program" with custom script, that will run journalctl and check content.

Best regards,
Martin

> On 17 Feb 2017, at 00:32, Jorge Pereira <[hidden email]> wrote:
>
> Hi,
>
>   Usually, I use the option 'content' to polling a file looking for the token. what should I use if I am running a system with systemd?
>
> <snip>
> check file telegraf_notwrite with path /var/log/mysystem.log
>     if content = "MyString" then alert
> </snip>
>
> do we have some plans to support some checks using the journalctl?
>
> I mean: journalctl -x -u mysystem.service
> --
> --
> Jorge Pereira
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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



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


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



--
--
Jorge Pereira

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

Re: What is the best approach to check log files using "journalctl"?

martinp@tildeslash.com
Thanks Jorge, contributions are welcomed.

You can see the contributions related info here: https://bitbucket.org/tildeslash/monit#markdown-header-contributing


> On 17 Feb 2017, at 16:33, Jorge Pereira <[hidden email]> wrote:
>
> Martin,
>
>   I would like to work on it. but, I am not sure about your policies to receive external patches. at first, do you have some advice to init the contribution to monit (agent) project? I am always trying to improve/help others OSS projects github.com/jpereira/
>
> On Fri, Feb 17, 2017 at 1:27 PM, Martin Pala <[hidden email]> wrote:
> No, at this point we don't have this on our list.
>
> I see it could be useful to observe systemd logs, there seems to be also sd-journal.h API, which may allow programatic access to logs, so it can be maybe added in the future.
>
>
>> On 17 Feb 2017, at 16:13, Jorge Pereira <[hidden email]> wrote:
>>
>> yes, But I wondering to know if exist plans to include the internal mechanism to do that avoiding external scripts.
>>
>> On Fri, Feb 17, 2017 at 9:17 AM, Martin Pala <[hidden email]> wrote:
>> Hi,
>>
>> you can use "check program" with custom script, that will run journalctl and check content.
>>
>> Best regards,
>> Martin
>>
>> > On 17 Feb 2017, at 00:32, Jorge Pereira <[hidden email]> wrote:
>> >
>> > Hi,
>> >
>> >   Usually, I use the option 'content' to polling a file looking for the token. what should I use if I am running a system with systemd?
>> >
>> > <snip>
>> > check file telegraf_notwrite with path /var/log/mysystem.log
>> >     if content = "MyString" then alert
>> > </snip>
>> >
>> > do we have some plans to support some checks using the journalctl?
>> >
>> > I mean: journalctl -x -u mysystem.service
>> > --
>> > --
>> > Jorge Pereira
>> > --
>> > To unsubscribe:
>> > https://lists.nongnu.org/mailman/listinfo/monit-general
>>
>>
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>>
>>
>>
>> --
>> --
>> Jorge Pereira
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
>
>
>
> --
> --
> Jorge Pereira
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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