The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

rk hunter cron email

Discussion in 'Security' started by johnchristy, May 4, 2014.

  1. johnchristy

    johnchristy Active Member

    Joined:
    Mar 7, 2014
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I'm using your rkhunter n my centos 6.5. I tested this script on 5.10 and the email report was working fine. on 6.5 its not working. the email attachment shows a name "noname" 1kb. I couldnt open that. Please refer attached screenshot

    my daily cron :

    [/etc/cron.daily]# cat rkhunter.sh
    #!/bin/sh
    (
    /usr/local/bin/rkhunter --versioncheck
    /usr/local/bin/rkhunter --update
    /usr/local/bin/rkhunter --cronjob
    ) | /bin/mail -s 'rkhunter Daily Run (PutYourServerNameHere)' xxxxxxxxxgmail.com

    Please advise

    Thanks
     

    Attached Files:

  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    Can you please try to use following code in your rkhunter.sh and check it

    Code:
    #!/bin/bash 
    /usr/local/bin/rkhunter -c --cronjob 2>&1 | mail -s “Rkhunter daily run on `uname -n`” email@domain.com
    
     
  3. johnchristy

    johnchristy Active Member

    Joined:
    Mar 7, 2014
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    That didnt work.. normally this is what i see online :

    #!/bin/sh
    (
    /usr/local/bin/rkhunter --versioncheck
    /usr/local/bin/rkhunter --update
    /usr/local/bin/rkhunter --cronjob
    ) | /bin/mail -s 'rkhunter Daily Run (PutYourServerNameHere)' email@email.com

    not sure why this is not working... I received attachment report via email, when i opened i see only :

    =================================
    [ Rootkit Hunter version 1.4.2 ]

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

    [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/tr [38C[ [1;32mNo update [0;39m ]
    Checking file i18n/tr.utf8 [33C[ [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 ]
    =================================

    it should show complete report...
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Please keep in mind that RKHunter is a third-party application that's not developed by cPanel. Do you notice any different behavior when you run the script manually instead of as a cron job?

    Thank you.
     
Loading...

Share This Page