Git Product home page Git Product logo

sar2html's Introduction

sar2html 4.0.0

sar2html is the plotting tool for system statistics (sar data) of following operating systems:

  • HPUX 11.11, 11.23, 11,31
  • Redhat 3, 4, 5, 6, 7
  • Solaris 5.9, 5.10, 5.11
  • Suse 8, 9, 10, 11, 12
  • Ubuntu 18, 20

image

RUNNING THE DOCKER IMAGE

ON DOCKER

If you want your performance data to be persistent you need to create data directory in your host and mount it to /sar2html/data like data folder below:

docker run -p 5000:5000 -v /data:/sar2html/data -d -h sar2html.localdomain cemtan/sar2html:4.0.0

Otherwise you may directly run the image:

docker run -p 5000:5000 -d -h sar2html.localdomain cemtan/sar2html:4.0.0

ON KUBERNETES

Simply run

kubectl run sar2html --image=cemtan/sar2html:4.0.0 --port=5000 --expose

Or download repository and enter the directory

git clone https://github.com/cemtan/sar2html.git

cd sar2html/conf/kubernetes

  • Deploy docker image

    • If you want your performance data to be persistent you need to create directory for them in your host:

      kubectl apply -f sar2html-pvc.yaml

      kubectl apply -f sar2html-deploy-persistent.yaml

    • Otherwise you may directly run the image:

      kubectl apply -f sar2html-deploy-ephemeral.yaml

    • Expose your pod.

    • For local installation of kubernetes (like minikube, microk8s...):

      kubectl apply -f sar2html-service-nodeport.yaml

    • For kubernetes which is able to use loadbalancer:

      kubectl apply -f sar2html-service-loadbalancer.yaml

ON OPENSHIFT CONTAINER PLATFORM

Download repository and enter the directory

git clone https://github.com/cemtan/sar2html.git

cd sar2html/conf/ocp

On master node create template from the sar2html.yaml

oc create -f sar2html.yaml

Now you may search for "SAR Database and Plotter" in Service Catalog and you may deploy sar2html through web-console.

CREATING THE DOCKER IMAGE

Download repository and enter the directory

git clone https://github.com/cemtan/sar2html.git

cd sar2html

If you are behind proxy edit 3 lines regarding proxy in dockerile and remove comment sign

#ENV http_proxy <YOUR HTTP PROXY>

#ENV https_proxy <YOUR HTTPS PROXY>

#RUN pear config-set http_proxy <YOUR HTTP PROXY>

If you want to build tour own image, clone repository or download source code and extract it:

sudo docker build --tag sar2html:4.0.0 .

INSTALLATION ON PHYSICAL OR VIRTUAL MACHINE

  • Install

    • python3
    • python3-dev
    • gcc
    • libc-dev
  • Download repository and enter the repository

    git clone https://github.com/cemtan/sar2html.git

    cd sar2html

  • Install python modules

    pip3 install -r requirements.txt

  • Run

    python3 sar2html.py

  • Open http://<ip_address_of_your_host>:5000

  • Now it is ready to work.

RECENT CHANGES

4.0.0

  • Leaving apache, php behind... sar2html is pure python now.

3.2.2

  • sar2html supports Ubuntu 20 now.
  • minor fixes

3.2.1

  • sar2html supports Ubuntu 18 now.
  • fixed some coding problems.

3.1.1

  • sar2html supports SLES 12 now.

3.0.1

  • Fixed some configuring and capturing issues (thanks to James Kenney)

3.0.0

  • New user interface is available.
  • Added navigation tab.

2.4.3

  • Added Redhat 7 support.
  • Fixed rare SA_DATE parsing issue (thanks to feistypenguin)
  • Fixed merging new and old sar data errors caused by device removal (patched by feistypenguin)
  • Fixed plotting errors caused by device removal (patched by James Kenney)

2.4.2

  • Solaris 11 is supported now.
  • Fixed HP-UX related issues.

2.4.1

  • Changed timeout settings and dependencies.

2.4.0

  • sar2html is able to connect servers to capture report now.

2.3.3

  • Error: If a server has performed a restart recently, it puts a "LINUX RESTART" entry in sar logs. When sar2ascii tries to grep out the date for a day using sar output it keys on the word "Linux". Ignoring case... so the "LINUX RESTART" entry will get globbed in with the date entry.
  • Error: Wrong argument is provided for SA_Redhat_3_b.

2.3.2

  • Added bookmarks to PDF file.

2.3.1

  • Reformatted PDF file.

2.3.0

  • sar2html generates PDF formatted report now.

2.2.2

  • Fixed bug causing "Argument list too long" error while too many devices exist.
  • Added show/hide devices option to web interface. Clicking device headers hides or shows device list.

2.2.1

  • Make-up

2.2.0

  • Added delete option

2.1.2

  • Fixed bugs

2.1.1

  • Added installation note

2.1.0

  • Added Redhat 6 Support
  • Fixed issues regarding Sles 11 Hosts

sar2html's People

Contributors

cemtan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sar2html's Issues

Add a security policy

Hello ๐Ÿ‘‹

I run a security community that finds and fixes vulnerabilities in OSS. A researcher (@Cimihan123) has found a potential issue, which I would be eager to share with you.

Could you add a SECURITY.md file with an e-mail address for me to send further details to? GitHub recommends a security policy to ensure issues are responsibly disclosed, and it would help direct researchers in the future.

Looking forward to hearing from you ๐Ÿ‘

(cc @huntr-helper)

500 Internal Server error when running on Windows docker desktop with a shared directory

I'm trying to run this on a Windows 10 Professional platform with Docker Desktop 20.10.16 and use a shared directory.

I'm able to mount the directory with:

docker run -p 5000:5000 -v j:\sar2html:/sar2html/data -d -h sar2html.localdomain cemtan/sar2html:4.0.0

The db files get written in the db directory. When I upload a tar.gz file, this also gets uploaded to the tmp directory. It appears to be unpacked correctly.

At that point, the browser returns the 500 Internal Server error.

Is there a place where I can look to find any error logs?

The platform works great when I don't use a shared directory.

500 Internal Server Error when uploading tar file

Description:
I use the provided sar2ascii tool to generate a tar file. When i attempt to upload that data into sar2html either via the BUI or using curl i receive a 500 - internal server error in response.

Running the app interactively i can see it generates the following error message:

[2021-11-19 14:13:01,876] ERROR in app: Exception on / [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "sar2html.py", line 400, in uploadFiles
updateThread = AppContextThread(target=updateDb(hostList, app.config['UPLOAD_FOLDER']))
File "sar2html.py", line 103, in updateDb
s2df.columns = s2col
File "/usr/local/lib64/python3.6/site-packages/pandas/core/generic.py", line 5154, in setattr
return object.setattr(self, name, value)
File "pandas/_libs/properties.pyx", line 66, in pandas._libs.properties.AxisProperty.set
File "/usr/local/lib64/python3.6/site-packages/pandas/core/generic.py", line 564, in _set_axis
self._mgr.set_axis(axis, labels)
File "/usr/local/lib64/python3.6/site-packages/pandas/core/internals/managers.py", line 227, in set_axis
f"Length mismatch: Expected axis has {old_len} elements, new "
ValueError: Length mismatch: Expected axis has 5 elements, new values have 6 elements
[pid: 25916|app: 0|req: 1/4] 172.17.65.101 () {48 vars in 1004 bytes} [Fri Nov 19 14:12:55 2021] POST / => generated 290 bytes in 6060 msecs (HTTP/1.1 500) 2 headers in 99 bytes (93 switches on core 0)

Steps to reproduce the behavior:
I followed the git clone, install requirements, installation process. Everything looked to install fine, the app starts fine and i can browse the app without error.

Expected behavior
Uploaded data is ingested into the app for viewing through the BUI

Screenshots
N/A just a standard 500 internal server error

Desktop (please complete the following information):

  • OS: Win10
  • Browser: Chrome
  • Version: 95.0.4638.69 (Official Build) (64-bit)

Additional context
Running on Oracle Linux 7.9

The error i receive from curl looks like this:

$ curl -F "file=@/tmp/sar2html-<MY_HOSTNAME>-2111191346.tar.gz" localhost:5000 -v

  • About to connect() to localhost port 5000 (#0)
  • Trying 127.0.0.1...
  • Connected to localhost (127.0.0.1) port 5000 (#0)

POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: localhost:5000
Accept: /
Content-Length: 1438783
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------66a41b0862f6

  • Done waiting for 100-continue
    < HTTP/1.1 500 INTERNAL SERVER ERROR
    < Content-Type: text/html; charset=utf-8
    < Content-Length: 290
  • HTTP error before end of send, stop sending
    <
<title>500 Internal Server Error</title>

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

* Closing connection 0

Getting error "apache2: Could not reliably determine the server's fully qualified domain name"

Hi,
When I run the docker image with below command (Ubuntu), I'm getting the error:
docker run -p 80:80 cemtan/sar2html:v3.2.1

Error:
Status: Downloaded newer image for cemtan/sar2html:v3.2.1
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Mon Feb 24 17:45:03.558021 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.1.20 configured -- resuming normal operations
[Mon Feb 24 17:45:03.558093 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Mon Feb 24 17:45:11.489179 2020] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.