To complete this step you need to clone https://gitlab.geant.net/msr-automation/cacti-utilisation on your local machine. This application will generate the script files which are being referred to in the description below.
Also, You will need to create a folder named "fix-scripts" somewhere on your local machine. In my case I had it under "C:\Users\Omar\projects\fix-scripts". This is the folder where all scripts will be loaded to.
Tip: "application.properties" file needs to be created in "/msr-cacti-utilisation/src/main/resources" inside that file it should have this line "files.outputdirectory=C:\\Users\\Omar\\projects\\fix-scripts\\ " This is the path for "fix-scripts" folder.
Steps to follow:
- Open Eclipse/IntelliJ and browse to "msr-cacti-utilisation" - As mentioned above, this is in Git https://gitlab.geant.net/msr-automation/cacti-utilisation
- Make sure to change the month and year in the "Main" class "cacti-utilisation\src\main\java\org\geant\msr\utilisation\Main.java" Lines 36 and 37
- Run the maven project (cacti utilisation) from Eclipse/IntelliJ. This will generate the script files and will save them in ""fix-scripts" folder.
- Copy the produced files (C:\Users\Omar\projects\fix-scripts) to your home directory on "prod-cacti01-fra-de.geant.net". You can use WinSCP client from Windows machine.
- Log into prod-cacti01-fra-de.geant.net
...
- as yourself
- Copy the scripts from your home directory to "/home/cactiuser/scripts" on "prod-cacti01-fra-de.geant.net". To copy multiple files: sudo cp fix_* /home/cactiuser/scripts/
change directory to /home/cactiuser/scripts
** Are you able to sudo as cactiuser? "sudo su cactiuser"
You will need to convert files from Dos to Unix - https://stackoverflow.com/questions/9374991/how-to-convert-files-from-dos-to-unix
- Run "sudo dos2unix ./fix*" inside "/home/cactiuser/scripts"
- Then, run "sudo ./fix_monthly_utilisation.sh -y 2017 -m 7" ** Pay attention to the year and the month value in the command.
Some circuits will be missing from the MSR GUI, and some circuits will show zeros, to fix that I have added those circuits in bash scripts which you can run, as below:
On prod-cacti01 "/home/cactiuser/scripts"
- Run this script "sudo ./missingCircuitsinip_util_lhconePage.sh -y2019 -m10" , this is for this page: http://test-msr.geant.net:8888/msr/ip_util_lhcone.jsp?type=percent
- Run this script "sudo ./missingCircuitsINip_util_ipv6Page.sh -y2019 -m10" , this is for this page: http://test-msr.geant.net:8888/msr/ip_util_ipv6.jsp
- Run this script "sudo ./missingCircuitsINint_util_details.sh -y2019 -m10" , this is for this page: http://test-msr.geant.net:8888/msr/int_util_details.jsp
- Run this script "sudo ./TooManyZerosIP_UTIL_IP-page.sh -y2019 -m10" , this is for this page http://test-msr.geant.net:8888/msr/ip_util_ip.jsp
Results will be shown on this page: http://test-msr.geant.net:8888/msr/ip_util_ip.jsp
The scripts below are what you've already generated from cacti-utilisation application and copied them from fix-scripts folder.
==================================================================================================================================
Run the following command:
...
This scripts calls the following scripts:
./fix_ip_access.sh -y $year -m $month >> /tmp/cacti_util_ip_access_$year_$month.log
./fix_ip_access_ias.sh -y $year -m $month >> /tmp/cacti_util_ip_access_ias_$year_$month.log
./fix_ip_access_ipv6.sh -y $year -m $month >> /tmp/cacti_util_ip_access_ipv6_$year_$month.log
./fix_interconnect.sh -y $year -m $month >> /tmp/cacti_util_interconnect_$year_$month.log
./interconnect_port_summ.sh -y $year -m $month >> /tmp/cacti_util_interconnect_port_summ_$year_$month.log
./fix_interconnect_ipv6.sh -y $year -m $month >> /tmp/cacti_util_interconnect_ipv6_$year_$month.log
./fix_trunks.sh -y $year -m $month >> /tmp/cacti_util_trunks_$year_$month.log
./fix_dws.sh -y $year -m $month >> /tmp/cacti_util_dws_$year_$month.log
./fix_plus.sh -y $year -m $month >> /tmp/cacti_util_plus_$year_$month.log
./fix_lhcone.sh -y $year -m $month >> /tmp/cacti_util_lhcone_$year_$month.log
./fix_eap.sh -y $year -m $month >> /tmp/cacti_util_eap_$year_$month.log
===================================================================================================================================
NOTE: for this page http://test-msr.geant.net:8888/msr/ip_util_ip.jsp the "Usage Peaks" percentage values are taken from opsdb directly not from the opsdb version sitting on MSR. So, in case of weird ( >100%) values in this page, you'll need to re-import opsdb script script "opsdb_import_new.sh" which is shown in page 1.1 in this documentation.
** You can see that log files are produced in the /tmp direcory of prod-cacti-fra-de.geant.net. These are useful when diagnosing zero values displayed in the MSR utilisation pages.
...