sarjitsu icon indicating copy to clipboard operation
sarjitsu copied to clipboard

Multiple dashboards are created with every sa file upload

Open whatsondoc opened this issue 5 years ago • 2 comments

Firstly, great framework! 👍

When collecting & uploading sa files to nginx, a new dashboard is created for every file. For example, if I upload the latest 31 SAR sa files from a host, I get 31 dashboards for that host, which appear to visualise metrics across the time window.

Behaviour appears to be consistent whether using Vizit or uploading directly from the web front-end.

Is there a way to group the input files, so that we only see a single dashboard for any given host?

Skärmavbild 2021-01-07 kl  14 38 48

A usage scenario is that over time, we have a script executed via cron to collect the latest sa file(s) from one or more hosts and copy locally, then upload to SARjitsu using Vizit.

Script contents:

#!/bin/bash

# Network details:
IP_SUBNET="1.2.3."        # Last octet left blank intentionally
TARGET_IPS=( 11 12 13 14 15 16 17 18 19 20 )        # Creating an array of specific IPs to connect to
USERNAME="${USER}"        # Using to more easily allow a different user context to be specified
#SSH_KEY="-i ${HOME}/.ssh/ssh_key"        # Path to ssh key, unless _id_rsa_ is used

# Sarjitsu details:
SARJITSU_PATH="/home/${USER}/sarjitsu"
SAR_LOCAL_DATA_PATH="${SARJITSU_PATH}/sar_data"
VIZIT_PATH="${SARJITSU_PATH}/utils"

# Logging the date to collect the relevant SAR files:
DAY="[0-9][0-9]"        # Capturing all sa* files, ignoring sar* ASCII text files
#DAY=$(date --date="yesterday" "+%d")        # Yesterday
#DAY=$(date "+%d")        # Today

cd ${VIZIT_PATH}        # Required unless being run in the 'vizit' directory, or the script is amended to reflect a full path for the variable 'APP_CONF'

for NODE_OCTET in ${TARGET_IPS[*]}
do
	NODE_IP_ADDRESS="${IP_SUBNET}${NODE_OCTET}"

	# Collecting the SAR files from each remote node:
	scp ${SSH_KEY} ${USERNAME}@${NODE_IP_ADDRESS}:/var/log/sa/sa${DAY} ${SAR_LOCAL_DATA_PATH}/${NODE_OCTET}/sa/${DAY}
	#scp ${SSH_KEY} ${USERNAME}@${NODE_IP_ADDRESS}:/var/log/sa/sar${DAY} ${SAR_LOCAL_DATA_PATH}/${NODE_OCTET}/sar/${DAY}
	
	# Uploading the collected SAR files to Sarjitsu using the Vizit client::
	./vizit -d ${SAR_LOCAL_DATA_PATH}/${NODE_OCTET}/sa
	#./vizit -p ${SAR_LOCAL_DATA_PATH}/${NODE_OCTET}/sar
	#./vizit -f ${SAR_LOCAL_DATA_PATH}/${NODE_OCTET}/sa/${COLLECT_FILES}${DAY}
done

echo "Daily SAR collection & ingest activities complete"
date

whatsondoc avatar Jan 07 '21 13:01 whatsondoc

Hi @whatsondoc Nice script there ;) This sounds like a decent feature request.

I've updated the labels. cc/ @portante thoughts?

arcolife avatar Jul 21 '22 22:07 arcolife

We might want to consider sar2pcp [1] and then just use Grafana [2] to view the data from PCP.

[1] https://man7.org/linux/man-pages/man1/sar2pcp.1.html [2] https://github.com/performancecopilot/grafana-pcp

portante avatar Jul 25 '22 21:07 portante