What's new

Scribe scribe 3.x_y - syslog-ng and logrotate installer

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Okay, @visortgw, please have a go at it. Same as before, copy the /tmp/scribelog file each time. This time though, please also check 'ls -al /jffs/syslog*' between running S01syslog-ng restart and scribe restart. I'm hopeful, but not positive, lol.
Code:
# cd /opt/etc/init.d/
# ./S01syslog-ng restart
 Shutting down syslog-ng...              done.
 Starting syslog-ng...              done.
TheS1R@GT-AX6000-9980:/tmp/mnt/TheS1RsUSB/entware/etc/init.d# cat /tmp/scribelog
  scribe_conf =
       optmsg =
      jffslog =
       tmplog =
       isjffs =
   syslog_loc =
syslog_loc is null
Found scribe_conf
  scribe_conf = /jffs/addons/scribe.d/config
       optmsg = /opt/var/log/messages
      jffslog = /jffs/syslog.log
       tmplog = /tmp/syslog.log
       isjffs = true
   syslog_loc = /jffs/syslog.log
optmsg is NOT a link
syslog_loc is a link
syslog_loc is a link
jffslog is NOT a directory
tmplog is a link
jffslog is NOT a directory
tmplog is a link
TheS1R@GT-AX6000-9980:/tmp/mnt/TheS1RsUSB/entware/etc/init.d# ls -al /jffs/syslog*
lrwxrwxrwx    1 TheS1R   root            21 Apr 27 23:44 /jffs/syslog.log -> /opt/var/log/messages
-rw-rw-rw-    1 TheS1R   root            24 Apr 27 23:44 /jffs/syslog.log-1


Code:
# scribe restart
                            _
                         _ ( )           
       ___    ___  _ __ (_)| |_      __   
     /',__) /'___)( '__)| || '_`\  /'__`\
     \__, \( (___ | |   | || |_) )(  ___/
     (____/`\____)(_)   (_)(_,__/'`\____)
     syslog-ng and logrotate installation
     v3.0_4 (gamma)     Coded by cmkelley

 stopping syslog-ng ... Checking syslog-ng...              alive.
 Shutting down syslog-ng...              done.
 starting system klogd and syslogd ...
Done.

 syslog-ng will be started at next reboot; you
 may type 'scribe restart' at shell prompt, or
 select rs from scribe menu to restart syslog-ng


 syslog-ng NOT running!  Starting  ...
 Starting syslog-ng...              done.
 Restarting uiScribe ...Mounting WebUI page for uiScribe

Mounted uiScribe WebUI page as Main_LogStatus_Content.asp


      checking syslog-ng daemon ... alive.

 checking system for necessary scribe hooks ...

          checking S01syslog-ng ... present.
         checking service-event ... present.
            checking post-mount ... present.
               checking unmount ... present.
    checking logrotate cron job ... updated.
       checking directory links ... present.

 checking syslog-ng configuration ...

   syslog-ng.conf version check ... in sync. (3.38)
    syslog-ng.conf syntax check ... okay!

          scribe installed version: v3.0_4 (gamma)
             scribe GitHub version: v3.0_4 (gamma)
                    scribe is up to date!


# cat /tmp/scribelog
  scribe_conf =
       optmsg =
      jffslog =
       tmplog =
       isjffs =
   syslog_loc =
syslog_loc is null
Found scribe_conf
  scribe_conf = /jffs/addons/scribe.d/config
       optmsg = /opt/var/log/messages
      jffslog = /jffs/syslog.log
       tmplog = /tmp/syslog.log
       isjffs = true
   syslog_loc = /jffs/syslog.log
optmsg is a link
syslog_loc is NOT a link
syslog_loc is a link
jffslog is NOT a directory
tmplog is NOT a link
jffslog is NOT a directory
tmplog is a link
# ls -al /jffs/syslog*
lrwxrwxrwx    1 TheS1R   root            21 Apr 27 23:47 /jffs/syslog.log -> /opt/var/log/messages
-rw-rw-rw-    1 TheS1R   root            24 Apr 27 23:47 /jffs/syslog.log-1
 
Code:
# cd /opt/etc/init.d/
# ./S01syslog-ng restart
 Shutting down syslog-ng...              done.
 Starting syslog-ng...              done.
TheS1R@GT-AX6000-9980:/tmp/mnt/TheS1RsUSB/entware/etc/init.d# cat /tmp/scribelog
  scribe_conf =
       optmsg =
      jffslog =
       tmplog =
       isjffs =
   syslog_loc =
syslog_loc is null
Found scribe_conf
  scribe_conf = /jffs/addons/scribe.d/config
       optmsg = /opt/var/log/messages
      jffslog = /jffs/syslog.log
       tmplog = /tmp/syslog.log
       isjffs = true
   syslog_loc = /jffs/syslog.log
optmsg is NOT a link
syslog_loc is a link
syslog_loc is a link
jffslog is NOT a directory
tmplog is a link
jffslog is NOT a directory
tmplog is a link
TheS1R@GT-AX6000-9980:/tmp/mnt/TheS1RsUSB/entware/etc/init.d# ls -al /jffs/syslog*
lrwxrwxrwx    1 TheS1R   root            21 Apr 27 23:44 /jffs/syslog.log -> /opt/var/log/messages
-rw-rw-rw-    1 TheS1R   root            24 Apr 27 23:44 /jffs/syslog.log-1


Code:
# scribe restart
                            _
                         _ ( )          
       ___    ___  _ __ (_)| |_      __  
     /',__) /'___)( '__)| || '_`\  /'__`\
     \__, \( (___ | |   | || |_) )(  ___/
     (____/`\____)(_)   (_)(_,__/'`\____)
     syslog-ng and logrotate installation
     v3.0_4 (gamma)     Coded by cmkelley

 stopping syslog-ng ... Checking syslog-ng...              alive.
 Shutting down syslog-ng...              done.
 starting system klogd and syslogd ...
Done.

 syslog-ng will be started at next reboot; you
 may type 'scribe restart' at shell prompt, or
 select rs from scribe menu to restart syslog-ng


 syslog-ng NOT running!  Starting  ...
 Starting syslog-ng...              done.
 Restarting uiScribe ...Mounting WebUI page for uiScribe

Mounted uiScribe WebUI page as Main_LogStatus_Content.asp


      checking syslog-ng daemon ... alive.

 checking system for necessary scribe hooks ...

          checking S01syslog-ng ... present.
         checking service-event ... present.
            checking post-mount ... present.
               checking unmount ... present.
    checking logrotate cron job ... updated.
       checking directory links ... present.

 checking syslog-ng configuration ...

   syslog-ng.conf version check ... in sync. (3.38)
    syslog-ng.conf syntax check ... okay!

          scribe installed version: v3.0_4 (gamma)
             scribe GitHub version: v3.0_4 (gamma)
                    scribe is up to date!


# cat /tmp/scribelog
  scribe_conf =
       optmsg =
      jffslog =
       tmplog =
       isjffs =
   syslog_loc =
syslog_loc is null
Found scribe_conf
  scribe_conf = /jffs/addons/scribe.d/config
       optmsg = /opt/var/log/messages
      jffslog = /jffs/syslog.log
       tmplog = /tmp/syslog.log
       isjffs = true
   syslog_loc = /jffs/syslog.log
optmsg is a link
syslog_loc is NOT a link
syslog_loc is a link
jffslog is NOT a directory
tmplog is NOT a link
jffslog is NOT a directory
tmplog is a link
# ls -al /jffs/syslog*
lrwxrwxrwx    1 TheS1R   root            21 Apr 27 23:47 /jffs/syslog.log -> /opt/var/log/messages
-rw-rw-rw-    1 TheS1R   root            24 Apr 27 23:47 /jffs/syslog.log-1
Okay, so it looks like that fixed it! In both instances /jffs/syslog.log is a link, as it should be.

Okay, last time (fingers crossed), update gamma (it should be 3.0_5) and use 'rs' from the menu. I've removed the menu_stop so hopefully restart will work correctly, since it worked correctly from /opt/etc/init.d/S01syslog-ng restart.

No need to post the scribelog file, just verify the links are correct (/jffs/syslog.log -> /opt/var/log/messages) please.
 
Okay, so it looks like that fixed it! In both instances /jffs/syslog.log is a link, as it should be.

Okay, last time (fingers crossed), update gamma (it should be 3.0_5) and use 'rs' from the menu. I've removed the menu_stop so hopefully restart will work correctly, since it worked correctly from /opt/etc/init.d/S01syslog-ng restart.

No need to post the scribelog file, just verify the links are correct (/jffs/syslog.log -> /opt/var/log/messages) please.
Fixed (after updating and executing "rs" from the menu)!
Code:
# ls -al /jffs/syslog*
lrwxrwxrwx    1 TheS1R   root            21 Apr 27 23:47 /jffs/syslog.log -> /opt/var/log/messages
-rw-rw-rw-    1 TheS1R   root            24 Apr 28 00:00 /jffs/syslog.log-1
 
Fixed (after updating and executing "rs" from the menu)!
Code:
# ls -al /jffs/syslog*
lrwxrwxrwx    1 TheS1R   root            21 Apr 27 23:47 /jffs/syslog.log -> /opt/var/log/messages
-rw-rw-rw-    1 TheS1R   root            24 Apr 28 00:00 /jffs/syslog.log-1
HOOORAY!!! Thank you SO MUCH for being my remote test router, lol. I know it's after midnight there, I appreciate you staying up. I'm gonna pull out the code that makes the scribelog file and tag it master, you can update at your leisure, the only "real" difference is the scribelog file.
 
HOOORAY!!! Thank you SO MUCH for being my remote test router, lol. I know it's after midnight there, I appreciate you staying up. I'm gonna pull out the code that makes the scribelog file and tag it master, you can update at your leisure, the only "real" difference is the scribelog file.
Make that remote remote test router — testing via VPN connection to home! ;)

Thank you as well for working through this.
 
Successfully updated scribe:
1682706027684.png

Thanks!
 
Yep, all looking pretty smooth for me on 3.0_5 here as well, thanks @cmkelley!
 
After I updated to 3.0.6 and noting in this thread the work that has gone to get there (thanks everyone & especially @cmkelley ) I had a look at my installation on the GT-AX6000 running 388.2. Noted I get this one line error message on the version check when I perform a 'st' and on completion perform a 'rs'. I re-booted the router, didn't change what occurs.

1682861198076.png
 
Thank you for the link. I thought the issue had been corrected (via "u" or reinstall), after such a long thread (five pages). I have George Jetson syndrome, which limits my technical knowledge to pushing a button ;)
LOL, no that's a separate issue from this 5 page thread. This 5 page thread was about an issue with certain routers moving the default location of syslog.log from /tmp to /jffs. THAT thread is about a problem caused by the simplified opkg package manager that didn't pick up all the dependencies of an upgrade. scribe wasn't the only thing to get clobbered by that one, a bunch of stuff got hit. I can't patch around that one because it's actually affecting entware programs. scribe and other scripts having issues is just because we rely on those entware programs. It has to be solved by forcing re-installation of the affected entware packages.
 
I have an idea that I want to monitor my information in a separate window with categorized, including SSD trim, health status, and usage space, as well as importing other custom jobs. I don't know how feasible it is.

For example, I have created some addon scripts.
螢幕擷取畫面 2023-05-02 073750.png


Write execution messages to the log through a logger cmd.
螢幕擷取畫面 2023-05-02 073916.png


However, these messages will be mixed with system messages, which makes it inconvenient to view them.
螢幕擷取畫面 2023-05-02 075124.png


I was wondering if it is possible to add a separate window to display addon messages?
螢幕擷取畫面 2023-05-02 073508.png
 
I have an idea that I want to monitor my information in a separate window with categorized, including SSD trim, health status, and usage space, as well as importing other custom jobs. I don't know how feasible it is.

For example, I have created some addon scripts.
View attachment 49825

Write execution messages to the log through a logger cmd.
View attachment 49826

However, these messages will be mixed with system messages, which makes it inconvenient to view them.
View attachment 49827

I was wondering if it is possible to add a separate window to display addon messages?
View attachment 49828
So, syslog-ng sees the logger -t tag as the "program", so I think something like:
Code:
destination d_arussdtrim {
    file("/opt/var/log/arusedtrim.log");
};

filter f_arussdtrim {
    program("aru-ssd-trim");
};

log {
    source(src);
    filter(f_arussdtrim);
    destination(d_arussdtrim);
    flags(final);
};
Should work to create the log; you'll also need to create a logrotate file, the examples in /opt/etc/logrotate.d should be enough to guide you. Then you need to go into uiScribe from your shell, and refresh the log list. Your log should show up in the webgui then.
 
So, syslog-ng sees the logger -t tag as the "program", so I think something like:
Code:
destination d_arussdtrim {
    file("/opt/var/log/arusedtrim.log");
};

filter f_arussdtrim {
    program("aru-ssd-trim");
};

log {
    source(src);
    filter(f_arussdtrim);
    destination(d_arussdtrim);
    flags(final);
};
Should work to create the log; you'll also need to create a logrotate file, the examples in /opt/etc/logrotate.d should be enough to guide you. Then you need to go into uiScribe from your shell, and refresh the log list. Your log should show up in the webgui then.
Thank you very much for providing a guide. I will take the time to study it carefully. Thanks!
 
Pushed 3.1_0

Stuff I backburnered in order to get 3.0 version working on 388 routers ...
  • Exported modified path to get firmware executables rather than give explicit paths to all binaries ( thanks @thelonelycoder )
  • Added checking syslog.log path to status
  • Added ability to redetect syslog.log location (useful if firmware changes the location)
  • Touch /var/lib/logrotate.status if it doesn't exist so syslog-ng doesn't whine
  • Added help and about as exists in other scripts ( thanks @dave14305 )
 
Pushed 3.1_1

There is a reason the scribe github page warns: "This software was written by someone who very likely didn't know what they were doing. There is a non-zero chance this software will not function as intended ..." You really should take such warnings seriously.

I blindly took the advice of shellcheck and screwed up setting the timezone in rc.func.syslog-ng. Some stuff doesn't work right if TZ isn't set. Hopefully this should cure the syslog-ng not starting when IPv6 is enabled problem some people have been having.

Sorry.
 
Hello, I have an issue. Scribe is not started upon a reboot of my router (AX88U). I need to do a scribe restart and then it is working fine, after each reboot.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top