### Dockerized Installation Commands Source: https://github.com/cemtan/sar2html/wiki/Home Commands to clone the repository, navigate to the directory, and start the SAR2HTML service using Docker Compose. ```bash git clone https://github.com/cemtan/sar2html.git cd sar2html/www ./sar2html -s ``` ```bash cd sar2html docker-compose up ``` -------------------------------- ### PHP Configuration for Manual Installation Source: https://github.com/cemtan/sar2html/wiki/Home Settings to adjust in the php.ini file for manual installation, specifically for file upload sizes. ```bash upload_max_filesize=2GB post_max_size=80MB ``` -------------------------------- ### Install sar2html Python Modules Source: https://github.com/cemtan/sar2html/blob/master/README.md Install the required Python modules for sar2html using pip. ```bash pip3 install -r requirements.txt ``` -------------------------------- ### Manual Installation Configuration Source: https://github.com/cemtan/sar2html/wiki/Home Commands to configure SAR2HTML manually after extracting the archive. Requires knowing the Apache user and group. ```bash ./sar2html -c ``` -------------------------------- ### Proxy Configuration in Dockerfile Source: https://github.com/cemtan/sar2html/blob/master/README.md Example lines in a Dockerfile for setting HTTP/HTTPS proxy environments. ```dockerfile #ENV http_proxy #ENV https_proxy #RUN pear config-set http_proxy ``` -------------------------------- ### Expose sar2html Service on Kubernetes (NodePort) Source: https://github.com/cemtan/sar2html/blob/master/README.md Apply Kubernetes service configuration for NodePort access, suitable for local installations like minikube. ```bash kubectl apply -f sar2html-service-nodeport.yaml ``` -------------------------------- ### Stream Sar Data via Crontab Entry Source: https://github.com/cemtan/sar2html/blob/master/templates/index.html Configure a crontab entry to periodically stream sar data to the Sar2HTML API. This requires sar2ascii to be installed and accessible. ```bash * * * * * /bin/bash -c "/usr/local/bin/sar2ascii -s sar2html.localdomain:5000" ``` -------------------------------- ### Create OpenShift Template Source: https://github.com/cemtan/sar2html/blob/master/README.md Create an OpenShift template from the sar2html.yaml file on the master node. ```bash oc create -f sar2html.yaml ``` -------------------------------- ### Deploy sar2html on Kubernetes (Ephemeral) Source: https://github.com/cemtan/sar2html/blob/master/README.md Apply Kubernetes configuration file to deploy sar2html with ephemeral storage. ```bash kubectl apply -f sar2html-deploy-ephemeral.yaml ``` -------------------------------- ### Deploy sar2html on Kubernetes (Persistent Volume) Source: https://github.com/cemtan/sar2html/blob/master/README.md Apply Kubernetes configuration files to deploy sar2html with persistent storage. ```bash kubectl apply -f sar2html-pvc.yaml kubectl apply -f sar2html-deploy-persistent.yaml ``` -------------------------------- ### Build sar2html Docker Image Source: https://github.com/cemtan/sar2html/blob/master/README.md Build the sar2html Docker image from the source code. ```bash sudo docker build --tag sar2html:4.0.0 . ``` -------------------------------- ### Run sar2html Docker Image (Persistent Data) Source: https://github.com/cemtan/sar2html/blob/master/README.md Run the sar2html Docker image, mounting a host directory to /sar2html/data for persistent performance data. ```bash docker run -p 5000:5000 -v /data:/sar2html/data -d -h sar2html.localdomain cemtan/sar2html:4.0.0 ``` -------------------------------- ### Deploy sar2html on Kubernetes Source: https://github.com/cemtan/sar2html/blob/master/README.md Deploy the sar2html Docker image on Kubernetes. ```bash kubectl run sar2html --image=cemtan/sar2html:4.0.0 --port=5000 --expose ``` -------------------------------- ### Run sar2html Docker Image (Ephemeral Data) Source: https://github.com/cemtan/sar2html/blob/master/README.md Run the sar2html Docker image without persistent data storage. ```bash docker run -p 5000:5000 -d -h sar2html.localdomain cemtan/sar2html:4.0.0 ``` -------------------------------- ### Expose sar2html Service on Kubernetes (LoadBalancer) Source: https://github.com/cemtan/sar2html/blob/master/README.md Apply Kubernetes service configuration for LoadBalancer access. ```bash kubectl apply -f sar2html-service-loadbalancer.yaml ``` -------------------------------- ### Run sar2html Python Application Source: https://github.com/cemtan/sar2html/blob/master/README.md Run the sar2html Python application. ```bash python3 sar2html.py ``` -------------------------------- ### Clone sar2html Repository Source: https://github.com/cemtan/sar2html/blob/master/README.md Clone the sar2html repository for Kubernetes or OCP deployment. ```bash git clone https://github.com/cemtan/sar2html.git ``` -------------------------------- ### Docker Proxy Configuration Source: https://github.com/cemtan/sar2html/wiki/Home Environment variables to set for HTTP and HTTPS proxy configurations within the Dockerfile. ```bash ENV http_proxy ENV https_proxy RUN pear config-set http_proxy ``` -------------------------------- ### Date Range Slider Initialization Source: https://github.com/cemtan/sar2html/blob/master/templates/post.html Initializes an ionRangeSlider with custom date formatting and event handling for form submission upon range change. ```javascript $( "#dateSlider" ).ionRangeSlider({ skin: "modern", prettify: tsToDate, type: "double", grid: true, from: {{ values }}.indexOf({{ start }}), to: {{ values }}.indexOf({{ end }}), values: {{ values }}, drag_interval: true, onFinish: function(data) { document.formSlider.submit();; } }); ``` -------------------------------- ### Form Submission on File Change Source: https://github.com/cemtan/sar2html/blob/master/templates/base.html This JavaScript code attaches an event listener to the file input element. When a file is selected, it automatically submits the associated form. ```javascript document.getElementById("file").onchange = function() { document.getElementById("form").submit(); }; ``` -------------------------------- ### Vega-Lite Chart Embedding Source: https://github.com/cemtan/sar2html/blob/master/templates/post.html Embeds a Vega-Lite chart specification into a DOM element once the document is loaded. Ensures the vega library is available. ```javascript document.addEventListener("DOMContentLoaded", function(event) { var spec = {{ chart | safe}}; var opt = { "mode": "vega-lite", "renderer": "canvas", "actions": {"editor": true, "source": true, "export": true} }; vegaEmbed('#plot-{{ loop.index }}', spec, opt).catch(console.err); }); ``` -------------------------------- ### Upload Sar Report via Curl Source: https://github.com/cemtan/sar2html/blob/master/templates/index.html Use this command to upload a sar report archive directly to the Sar2HTML API. Ensure the file path and server address are correct. ```bash curl -F "file=@/tmp/sar2html-localhost-1407101131.tar.gz" sar2html.localhost:5000 ``` -------------------------------- ### Date Formatting Function Source: https://github.com/cemtan/sar2html/blob/master/templates/post.html A JavaScript function to format a timestamp into a human-readable date string for use with UI elements. ```javascript function tsToDate (ts) { var d = new Date(ts); return d.toLocaleDateString({ year: 'numeric', month: 'long', day: 'numeric' }); } ``` -------------------------------- ### Enable JavaScript Class Source: https://github.com/cemtan/sar2html/blob/master/templates/base.html This snippet adds a 'js' class to the HTML tag, replacing 'no-js' if present. It's used to detect and enable JavaScript functionality. ```javascript function(e,t,n){var r=e.querySelectorAll("html")[0];r.className=r.className.replace(/(^|\s)no-js(\s|$)/,"$1js$2")})(document,window,0) ``` -------------------------------- ### Confirm and Submit Delete Range Form Source: https://github.com/cemtan/sar2html/blob/master/templates/post.html JavaScript function to confirm user intent before submitting a form to delete a range. ```javascript function confirmRangeSubmit() { var agree=confirm("Are you sure you wish to delete the range?"); if (agree) document.forms["deleteRange"].submit(); else return false ; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.