Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not work on Ubuntu 20.04? #2

Open
wakjoko opened this issue Nov 19, 2021 · 4 comments
Open

does not work on Ubuntu 20.04? #2

wakjoko opened this issue Nov 19, 2021 · 4 comments

Comments

@wakjoko
Copy link

wakjoko commented Nov 19, 2021

hi, thanks for a great tool. appreciate your effort of making this tool but seems does not work in ubuntu or did i miss anything?

here's my config

{
	"monitors": [
		{
			"name": "Test Monitor",
			"path": "~/logs-to-watch/*.log",
			"match": "ALERT|WARNING|ERROR",
			"email": "me@gmail.com",
                        "mode": "whole",
                        "checksum": true
		}
	],
	"mail_settings": {
		"host": "smtp.gmail.com",
		"port": 587,
		"secure": false,
		"auth": {
			"user": "me@gmail.com",
			"pass": "****"
		},
		"from": "me@gmail.com"
	},
	"sleep": 5,
	"echo": 1,
	"verbose": 2
}
@jhuckaby
Copy link
Owner

Please explain what "does not work" means. Are you seeing an error? Does the binary not launch? What is the output on the Terminal?

It's possible that LogAlert cannot interpret what the ~ symbol means in your path here:

    "path": "~/logs-to-watch/*.log",

I'm no Linux expert, but I seem to recall that that symbol (~) only works inside of a shell / terminal. That is a shell metacharacter, which is "expanded" to the current user's home directory when the path is evaluated. But LogAlert doesn't use a shell, and has no idea how to expand that character. Can you try changing this to use the full path to the file(s) you want to monitor?

@wakjoko
Copy link
Author

wakjoko commented Nov 19, 2021

Hey, sorry if i offended you.

the ~ is an alias for /home/user.

Binary did run and i can see the output in terminal after executing ./logalert.bin

[2021-11-19 09:17:41][LogAlert][LogAlert/1.0.0 starting up][]
[2021-11-19 09:17:41][Test Monitor][Performing initial scan: /home/user/logs-to-watch/*.log][]

then i open up other terminal to edit a file in the logs-to-watch directory and save the file with edited content.

i'm expecting to get an email right after manually editing a file but no email received even in spam, i don't see new email.

and i don't see any update in my other terminal that's running the logalert.bin

so did i made myself clear of what "does not work" means?

i have a feeling that i may missed something but i can't figure it out

@jhuckaby
Copy link
Owner

You didn't offend me at all. I am not sure why LogAlert isn't working for you, however. That is really strange.

Can you get it to work on a different directory? Something like /tmp/? I'm just wondering if it has something to do with the particular directory you are using, i.e. permissions or other.

@wakjoko
Copy link
Author

wakjoko commented Nov 19, 2021

You might be right, I'm running the binary without sudo and execute it within a user with just ./logalert.bin
I'll look into that and thanks for your time anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants