JGrana
Very Senior Member
I have re-written a more useful script for analyzing files using AI bots - chatai
Plus, the web integration was a nightmare ;-)
This code will no longer be supported
@aru created a Python script to send /tmp/syslog.log to Googles Gemini AI for it's analysis.
I used his original script and was somewhat impressed with the results from Google Gemini AI. ~80% pretty good comments, a few, well, somewhat interesting ;-)
The original script was based on python. Knowing that some will not want to install python/pip and the fact I’m not good at all with python, I decided to convert it to /bin/sh (no bash needed) and add some bells and whistles, an install/uninstall/update ala Addons method and a Readme.
A few caveats:
1) I’m no html programmer. I am learning via this script - the Addon web page is pretty primitive. I would like it to have a similar look and feel to things like spdmerlin, etc. - (where’s @Jack Yaz when you need him - LOL). I also would (and am researching) a “Refresh” button for the web page. Unfortunately you have to run “genailogs” from a command line (and maybe cron) to get results updates…
2) Speaking of cron - that’s on my todo list. Add/remove a cron job. Kind of on the fence since the log (or logs) are dynamic and every run of genailogs is a “snapshot” of some recent period of time. I have most of it coded - will release it when it's ready.
3) Some of the bells and whistles (command line option):
noweb - show the question (and log) and results to the terminal (stdout) rather than update the web page. If genailogs is run from stdin, it pipes the output through more. If run from a script or a redirect - it just streams everything (good for scripting).
verbose - show the q/a to the terminal and update the web page.
watch - run genailogs in a continuous loop every SLDELAY seconds (default = 5 minutes) and show on the screen (stdout). Press any key to exit.
4) Genailogs can send multiple log files. The default is just /tmp/syslog.log. If you want others, just add them to the LOGFILES variable in the conf file. I have skynet added to mine.
You can also adjust the number of lines of the log file sent for analysis. The default is 40 on the day genailogs is run. Edit NUMLINES in the conf to adjust this.
The github Readme has more details.
5) Don’t shoot the messenger - the results can be pretty helpful - it discovered 2 devices on my network asking for the same IP address. But, there are times where it’s results are a bit “obtuse”.
6) Genailogs requires a Google Gemini API key. It’s pretty easy, @aru gives good instructions.
Go to the link, get a Key and add it to the .conf file. More information is in the Readme
7) Version 0.4.2 introduced an interactive "chat" mode. You can ask various questions and get responses from GeminiAI. Fun stuff. BTW, If you keep asking the same question - you will often get more/different/ responses.
Here is the help command output:
genailogs (Ver 0.4.2) - send one or more log files (or chat) to Google Gemini AI
and display the results in an Addon web page and/or the terminal
Usage: genailogs [help] [install] [uninstall] [update] [results] [noweb] [verbose] [cron add|del|run] [chat]
help - show this message
results - just show the response/results from Gemini AI
noweb - don't create the web page, just show the results
verbose - both create the web page and show the results
watch - send logs/get results every SLDELAY seconds in a loop
press any key to exit
cron [add|del|run] - cron job - log the last
additional argument: add - add a cron entry
del - delete the cron job
run - run the cron job
chat - start an interactive chat session with GeminiAI
install - install genailogs and create addon dir and config file
uninstall - remove genailogs and its directory and config file
update - check for and optionally update
Ok, if you want to try it out, here is my github page with genailogs. Look over the Readme to install and how to use all the command line options
Plus, the web integration was a nightmare ;-)
This code will no longer be supported
@aru created a Python script to send /tmp/syslog.log to Googles Gemini AI for it's analysis.
I used his original script and was somewhat impressed with the results from Google Gemini AI. ~80% pretty good comments, a few, well, somewhat interesting ;-)
The original script was based on python. Knowing that some will not want to install python/pip and the fact I’m not good at all with python, I decided to convert it to /bin/sh (no bash needed) and add some bells and whistles, an install/uninstall/update ala Addons method and a Readme.
A few caveats:
1) I’m no html programmer. I am learning via this script - the Addon web page is pretty primitive. I would like it to have a similar look and feel to things like spdmerlin, etc. - (where’s @Jack Yaz when you need him - LOL). I also would (and am researching) a “Refresh” button for the web page. Unfortunately you have to run “genailogs” from a command line (and maybe cron) to get results updates…
2) Speaking of cron - that’s on my todo list. Add/remove a cron job. Kind of on the fence since the log (or logs) are dynamic and every run of genailogs is a “snapshot” of some recent period of time. I have most of it coded - will release it when it's ready.
3) Some of the bells and whistles (command line option):
noweb - show the question (and log) and results to the terminal (stdout) rather than update the web page. If genailogs is run from stdin, it pipes the output through more. If run from a script or a redirect - it just streams everything (good for scripting).
verbose - show the q/a to the terminal and update the web page.
watch - run genailogs in a continuous loop every SLDELAY seconds (default = 5 minutes) and show on the screen (stdout). Press any key to exit.
4) Genailogs can send multiple log files. The default is just /tmp/syslog.log. If you want others, just add them to the LOGFILES variable in the conf file. I have skynet added to mine.
You can also adjust the number of lines of the log file sent for analysis. The default is 40 on the day genailogs is run. Edit NUMLINES in the conf to adjust this.
The github Readme has more details.
5) Don’t shoot the messenger - the results can be pretty helpful - it discovered 2 devices on my network asking for the same IP address. But, there are times where it’s results are a bit “obtuse”.
6) Genailogs requires a Google Gemini API key. It’s pretty easy, @aru gives good instructions.
Go to the link, get a Key and add it to the .conf file. More information is in the Readme
7) Version 0.4.2 introduced an interactive "chat" mode. You can ask various questions and get responses from GeminiAI. Fun stuff. BTW, If you keep asking the same question - you will often get more/different/ responses.
Here is the help command output:
genailogs (Ver 0.4.2) - send one or more log files (or chat) to Google Gemini AI
and display the results in an Addon web page and/or the terminal
Usage: genailogs [help] [install] [uninstall] [update] [results] [noweb] [verbose] [cron add|del|run] [chat]
help - show this message
results - just show the response/results from Gemini AI
noweb - don't create the web page, just show the results
verbose - both create the web page and show the results
watch - send logs/get results every SLDELAY seconds in a loop
press any key to exit
cron [add|del|run] - cron job - log the last
additional argument: add - add a cron entry
del - delete the cron job
run - run the cron job
chat - start an interactive chat session with GeminiAI
install - install genailogs and create addon dir and config file
uninstall - remove genailogs and its directory and config file
update - check for and optionally update
Ok, if you want to try it out, here is my github page with genailogs. Look over the Readme to install and how to use all the command line options
GitHub - JGrana01/genailogs: Get Gemeni AI to opine on various log files
Get Gemeni AI to opine on various log files. Contribute to JGrana01/genailogs development by creating an account on GitHub.
github.com
Last edited: