Remove [1;33m from rkhunter output

General Discussion of atomic repo and development projects.

Ask for help here with anything else not covered by other forums.
User avatar
webfeatus
Forum Regular
Forum Regular
Posts: 196
Joined: Wed Jan 13, 2010 9:11 am
Location: Bali

Remove [1;33m from rkhunter output

Unread post by webfeatus »

[ Rootkit Hunter version 1.3.6 ]

[1;33mChecking rkhunter version... [0;39m
This version : 1.3.6
Latest version: 1.3.6
[ Rootkit Hunter version 1.3.6 ]

[1;33mChecking rkhunter data files... [0;39m
Checking file mirrors.dat [34C[ [1;32mNo update [0;39m ]
Checking file programs_bad.dat [29C[ [1;32mNo update [0;39m ]
Checking file backdoorports.dat [28C[ [1;32mNo update [0;39m ]
Checking file suspscan.dat [33C[ [1;32mNo update [0;39m ]
Checking file i18n/cn [38C[ [1;32mNo update [0;39m ]
Checking file i18n/de [38C[ [1;32mNo update [0;39m ]
Checking file i18n/en [38C[ [1;32mNo update [0;39m ]
Checking file i18n/zh [38C[ [1;32mNo update [0;39m ]
Checking file i18n/zh.utf8 [33C[ [1;32mNo update [0;39m ]

Anyone know how to remove the weird characters?

This is my cron script:

Code: Select all

#!/bin/sh
(
/usr/local/bin/rkhunter --versioncheck
/usr/local/bin/rkhunter --update
/usr/local/bin/rkhunter --cronjob --report-warnings-only
) | /bin/mail -s 'rkhunter Daily Run on server' my@email.com
They say that good intentions, pave the road to hell;
If a thing is not worth doing, it's not worth doing well.
User avatar
mikeshinn
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 4155
Joined: Thu Feb 07, 2008 7:49 pm
Location: Chantilly, VA

Re: Remove [1;33m from rkhunter output

Unread post by mikeshinn »

Those are ANSI color codes. You need to use the --nocolors option.
User avatar
webfeatus
Forum Regular
Forum Regular
Posts: 196
Joined: Wed Jan 13, 2010 9:11 am
Location: Bali

Re: Remove [1;33m from rkhunter output

Unread post by webfeatus »

Yes, I tried that once before, without success.
This time I have placed it on a separate line.

Code: Select all

#!/bin/sh
(
/usr/local/bin/rkhunter --versioncheck
/usr/local/bin/rkhunter --update
/usr/local/bin/rkhunter --cronjob --report-warnings-only
/usr/local/bin/rkhunter --nocolors
) | /bin/mail -s 'rkhunter Daily Run on server' email@me.com
(lazily) I will let the cron run tomorrow...
They say that good intentions, pave the road to hell;
If a thing is not worth doing, it's not worth doing well.
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: Remove [1;33m from rkhunter output

Unread post by scott »

Also this -> /usr/local/bin/rkhunter is not our rkhunter. So your problems might be related to that.
User avatar
webfeatus
Forum Regular
Forum Regular
Posts: 196
Joined: Wed Jan 13, 2010 9:11 am
Location: Bali

Re: Remove [1;33m from rkhunter output

Unread post by webfeatus »

scott wrote:Also this -> /usr/local/bin/rkhunter is not our rkhunter. So your problems might be related to that.
Yes, it is a standalone version on the host server.
ASL & your rkhunter are on the virtual.
They say that good intentions, pave the road to hell;
If a thing is not worth doing, it's not worth doing well.
User avatar
mikeshinn
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 4155
Joined: Thu Feb 07, 2008 7:49 pm
Location: Chantilly, VA

Re: Remove [1;33m from rkhunter output

Unread post by mikeshinn »

You need to call "--nocolors" each time you invoke rkhunter when you want it to not generate ANSI colors.

/usr/local/bin/rkhunter --versioncheck --nocolors
/usr/local/bin/rkhunter --update --nocolors
/usr/local/bin/rkhunter --cronjob --report-warnings-only --nocolors

You also dont need to call rkhunter each time, you can stack those options if you like:

rkhunter --versioncheck --update --cronjob --report-warnings-only --nocolors
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: Remove [1;33m from rkhunter output

Unread post by breun »

From rkhunter --help:
--cronjob Run as a cron job
(implies -c, --sk and --nocolors options)
So, when using --cronjob you don't even need to specify --nocolors. :)

(I see ART's rkhunter also uses both --cronjob and --nocolor in /etc/cron.daily/rkhunter, but yeah, it still works, so it doesn't matter much.)
Lemonbit Internet Dedicated Server Management
User avatar
webfeatus
Forum Regular
Forum Regular
Posts: 196
Joined: Wed Jan 13, 2010 9:11 am
Location: Bali

Re: Remove [1;33m from rkhunter output

Unread post by webfeatus »

I found that this separates the output nicely.

Code: Select all

/usr/local/bin/rkhunter --versioncheck --nocolors
/usr/local/bin/rkhunter --update --nocolors
/usr/local/bin/rkhunter --cronjob --report-warnings-only --nocolors
Other options work but do not separate the output like the above option.
They say that good intentions, pave the road to hell;
If a thing is not worth doing, it's not worth doing well.
Post Reply