Useful commands to support Reporter on Linux

book

Article ID: 167145

calendar_today

Updated On:

Products

Reporter

Issue/Introduction

What are some useful commands to know when working with Linux?

Resolution

Start and Stop Reporter

Navigate to the /etc/init.d folder.
    Enter ./bcreporter start to start it.
    Enter ./bcreporter stop to stop it.

Start Reporter from within a Terminal Window

    Navigate to the /opt/bc/reporter folder.
    Enter ./bcreporter.

NOTE:  If you want Reporter to remain running after you terminate your SSH session, insert the nohup command in front; for example: nohup bcreporter.

Find out if Reporter is Running on the Server  

    Navigate to the /etc/init.d folder.
    Enter ./bcreporter status.

Find out if Reporter is Installed on the Server

    Navigate to the /opt/bc/reporter folder and look for the Reporter binary; for example:
       From any folder, enter RPM -qa | grep reporter.

Display a Journal File on the Terminal

    Navigate to /opt/bc/reporter/journal/.
    Enter cat jour and then press the Tab key. This action displays all of the journals.
        NOTE: In some versions, this journal file is found in the installed root folder.

Navigate Around the File System

    Enter cd to change directories.
    Enter pwd to find out where in the file system you are.
        NOTE: For a directory listing, enter ls -l.

Discover What Version of Linux is Running

    Enter uname -a to display the kernel version.
    Enter cat /etc/redhat-release to dispaly the Red Hat® version.

Discover if Reporter Has Been Runninge In the Background or the Foreground

    Enter jobs -l.
    The result of this command might indicate bcreporter is running in the background but stopped:
           [1] + Stopped (user)      /opt/bc/reporter/bcreporter
    NOTE: If you start Reporter in a terminal window (you used SSH to connect to the Linux server and started it that way) and you terminate the connection, Reporter also stops.

Place Reporter in the Foreground

    Enter fg 1.
    This action immediately starts Reporter and displays the login screen (to the same screen you are currently on).
    NOTE: You must use the number of the process that the jobs command showed was stopped.

Place Reporter in the Background
    Enter bg 1.
    This action restarts Reporter in the background.
    NOTE: If you start Reporter in a terminal window (you used SSH to connect to the Linux server and started it that way) and you terminate the connection, Reporter also stops.

Discover how long the LINUX server has been up and running

    Enter uptime.

Collect the Amount of Memory Available to the System

    Enter cat  /proc/meminfo.

Discover how much Disk Space is Available to Reporter

    Navigate to the opt/bc/reporter folder.
    Enter df  -h.

Discover what binary dependencies there are for a LINUX program use the following command

    Navigate to where Reporter is installed.
    Enter ldd bcreporter.
    NOTE: If you start Reporter in a terminal window:

libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ba56fc38000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002ba56fe52000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002ba570056000)
libm.so.6 => /lib64/libm.so.6 (0x00002ba570357000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002ba5705da000)
libc.so.6 => /lib64/libc.so.6 (0x00002ba5707e8000)
/lib64/ld-linux-x86-64.so.2 (0x00002ba56fa1c000)

Discover if Any Other Reporter Service is Running on Your LINUX Server

    Enter ps -aux | grep reporter.

Download the Latest Version of Reporter But Don't Have Access to the UI of the LINUX Server

Use the following wget command:

  1.     Login into your BTO account and navigate to the Reporter download links.
  2.     Copy and paste the link into your browser.
  3.     SSH to your Reporter LINUX server and login.
  4.     Enter wget your_url and press Return.
  5.     The RPM downloads, but is saved as a filename that is similar to the end of the URL above (such as a number).
  6.     Using the mv command, you can now rename the file to distinguish the downloaded file (for example: Reporter_9.1.3.2_42002_linux64.rpm).
  7.     You can now use this RPM file to install Reporter.

Install and/or Upgrade Blue Coat Reporter

    NOTE: Verify that you have downloaded the correct Blue Coat RPM to your LINUX service before executing the following step. See the article at the end of this document for more details.

    From any location, enter rpm -Uhv Reporter_9*.rpm.
        The action results in installation to /opt/bc/reporter.
    For custom directory, execute the following command:
        rpm -Uhv --prefix=<custom-directory> Reporter_9*.rpm
    After installing, run the do-startup.sh script to configure the admin password, license, and start Reporter. The upgrade automatically begins the process.

Uninstall Blue Coat Reporter

    From any location, enter rpm -e bcrep and press Tab (to find the correct syntax)
    Navigate to /opt/bc/reporter.
    Enter do-cleanup.sh.
       NOTE: This action removes all the remaining folders.

Discover More Information About a Particular Library (Such As the LDAP Library)

    Enter rpm -qfi /usr/lib/libldap.so.
       NOTE: Whenever you run a executable in LINUX, you must prefix it with ./. This ensures that LINUX finds the executable in the same folder that you are currently in and runs it.

Discover the IP Address(es) That the LINUX Server is Configured

    Enter ifconfig.

Discover What TCP/UDP Ports are Listening on the Server

    Enter netstat -a.
    NOTE: You can pipe this to the grep command to find Reporter.

How to Tell if Your Red Hat LINUX Server is 32-bit or 64-bit?

From the Terminal window, execute the following command:
     cat /proc/cpuinfo
     NOTE: At the bottom of the output, you'll see flags. If the server is a 64-bit server, it's an lm flag.
     Example:
           cat /proc/cpuinfo
        processor : 0
        vendor_id : GenuineIntel
        cpu family : 15
        model : 4
        model name : Intel(R) Xeon(TM) CPU 3.00GHz
        stepping : 1
        cpu MHz : 2793.136
        cache size : 1024 KB
        fdiv_bug : no
        hlt_bug : no
        f00f_bug : no
        coma_bug : no
        fpu : yes
        fpu_exception : yes
        cpuid level : 5
        wp : yes
        flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
        pat pse36 clflush dts acpi mmx fxsr sse sse2 ss

Useful Find Command

TIP: To find out where Reporter is installed on LINUX without using an RPM command (because it was not installed by RPMS):
       Navigate to the root of the file system and execute the following commands:
       Enter [[email protected] /]# find  -type d -name reporter
       NOTE: Substituting -name for -iname in the above command makes the Find Command insensitive to case.
       To find any file (such as the httpd.conf file), use the following command
       Enter [email protected] /]# find /  -name httpd.conf

Command to remove the ".done" extension from all logs in a directory:

If you need to remove the .done extension from previously processed logs, you can do this with a single command for all logs in a directory:

- Navigate to the directory containing the log files

- Run this command to remove ".done" from all logs that have previously been processed:

for i in `ls | grep '\.done$'`; do mv $i `echo $i | sed -e 's/\.done$//g'`; done