ASR920 – untagged vlan

interface GigabitEthernet0/0/0
 no ip address
 media-type rj45
 negotiation auto
 service instance 1 ethernet
  encapsulation untagged
  bridge-domain 123
 !
# gdzie bridge-domain to nasz vlan, który chcemy "odtagować"

Wanguard + InfluxDB = wykresy na sterydach

Wanguard od wersji 7.2 umożliwia użycie InfluxDB (docelowo zastąpi RRDTool) do przechowywania danych z wykresów.

Wanguard 7.2 brings the following new features and changes:

  • Adds support for storing graph data in InfluxDB, as an alternative to using RRD files. While it is possible to use both InfluxDB and RRD backends at the same time, we only recommend using the InfluxDB backend for the following reasons:
    • Adding and deleting decoders for IP graphs does not reset the existing data
    • It enables High Availability setups with graph data stored on redundant, remote InfluxDB servers
    • It is much more space efficient in most configurations
    • Is compatible with our own rendering engine which generates better-looking graphs
    • It allows an easy integration with other third-party products such as Grafana
    • RRDTool support might be deprecated in the future

Instrukcja przejścia z RRDTool na InfluxDB znajduje się w dokumentacji na stronie 21.

InfluxDB – This is the recommended storage engine for most installations. To be able to use it you must first install InfluxDB 1.x from www.influxdata.com/time-series-platform, and then set enabled=true in the [http] section from /etc/influxdb/influxdb.conf. InfluxDB URL is mandatory and it should contain the URL to the InfluxDB http or https server (e.g. http:// 192.168.1.1:8086). InfluxDB Username and InfluxDB Password are optional and should be set only if auth-enabled=true in influxdb.conf. Click on the button to create a new InfluxDB database called “andrisoft” which will store the graph data.

MariaDB: Could not increase number of max_open_files to more than 1024

Mamy problem, a raczej ostrzeżenie.

mysqld[776]: 2019-10-04 11:39:53 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 4186)
mysqld[776]: 2019-10-04 11:39:53 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)

Jak sprawdzić aktualną wartość max_open_files ?

SHOW VARIABLES LIKE 'open_files_limit';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| open_files_limit | 1024  |
+------------------+-------+

Procedura naprawy wygląda następująco.

cp /usr/lib/systemd/system/mariadb.service /etc/systemd/system
mkdir /etc/systemd/system/mariadb.service.d/
nano /etc/systemd/system/mariadb.service.d/limits.conf
cd /etc/systemd/system/mariadb.service.d/
echo "[Service]" >> limits.conf
echo "LimitNOFILE=4186" >> limits.conf
systemctl daemon-reload
systemctl restart mariadb

Werifikujemy w logach czy nie ma żadnych ostrzeżeń lub błędów. Sprawdzamy obecną wartość max_open_files

SHOW VARIABLES LIKE 'open_files_limit';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| open_files_limit | 4186  |
+------------------+-------+

Naprawianie obrazu dysku Qcow2

Prawdopodobnie mój obraz ucierpiał z powodu dużego obciążenia operacjami I/O mimo, iż miałem Virtio-SCSI: https://forum.proxmox.com/threads/qcow2-corruption-after-snapshot-or-heavy-disk-i-o.32865/

qemu-img check disk.qcow2

ERROR OFLAG_COPIED data cluster: l2_entry=8cfdb0000 refcount=1

43782 errors were found on the image.
Data may be corrupted, or further writes to the image may corrupt it.

424996 leaked clusters were found on the image.
This means waste of disk space, but no harm to data.
524288/524288 = 100.00% allocated, 10.45% fragmented, 0.00% compressed clusters
Image end offset: 41744859136

If -r is specified, qemu-img tries to repair any inconsistencies found during the check. -r leaks repairs only cluster leaks, whereas -r all fixes all kinds of errors, with a higher risk of choosing the wrong fix or hiding corruption that has already occurred.

qemu-img check -r all disk.qcow2

Repairing OFLAG_COPIED data cluster: l2_entry=8000000885b30000 refcount=2
The following inconsistencies were found and repaired:

    424996 leaked clusters
    36838 corruptions

Double checking the fixed image now...
No errors were found on the image.
524288/524288 = 100.00% allocated, 10.45% fragmented, 0.00% compressed clusters
Image end offset: 41744859136

UWAGA! Lepiej zrobić najpierw opcję LEAKS, a potem w ostateczności ALL.

qemu-img check disk.qcow2

No errors were found on the image.
524288/524288 = 100.00% allocated, 10.45% fragmented, 0.00% compressed clusters
Image end offset: 41744859136

Link do manuala: https://www.qemu.org/documentation/

8h siedzenia na tyłku

Nieeeeeee!

Trzeba się ruszać i ruszam się ja 🙂

GARMIN

STRAVA

ENDOMONDO

Dłuuuuugo zwlekałem, ale od 19 lipca 2019 roku ruszyła maszyna.

Biegam codziennie chyba, że… nie wiem co! 🙂

Polecam tutaj YT kanał HellahGood, który mnie zmotywował do codziennego biegania.

Poprzeczka została ustalono na minimum 2km dziennie! Warto ustalić realne cele i je konsekwetnie realizować. Mróz, wiatr, deszcz, wczesne wstawanie, jeśli Twój cel staje się nawykiem nic nie stoi na przeszkodzie.

Pobudka, ubierasz sie i skoro już się ubrałeś to idziesz biegać nie zastanwiasz sie tylko rób swoje np. biegaj lub spaceruj.

Pamietaj w miarę jedzenia apetyt rośnie.

GenieACS – manualny upload i download FW

Wysyłamy FW do GenieACS tutaj przykład dla DIR 825/EE:

curl -i 'http://[URL-to-ACS-server]:7557/files/DIR_825_1.0.2.bin' -X PUT --data-binary @"./2019.08.28-17.15_DIR_825AC_G1A_EU_1.0.2_release.bin" --header "fileType: 1 Firmware Upgrade Image" --header "oui: 58D56E" --header "productClass: Router" --header "version: 1.0.2"

Wersja obrazkowa obrazuje krok po kroku co trzeba wyklikać, aby wgrać nowy FW dla wybranego urządzenia.

Po zatwierdzeniu poleceniem Commit logi potwierdzają rozpoczęcie procedury aktualizacji FW.

==> /var/log/genieacs/genieacs-cmwp-access.log <== 
 2019-09-17T13:18:23.444Z [INFO] 1.2.3.4 58D56E-Router-QXNN1IA001843: Inform; cpeRequestId="10" informEvent="6 CONNECTION REQUEST" informRetryCount=0 
 2019-09-17T13:18:23.459Z [INFO] 1.2.3.4 58D56E-Router-QXNN1IA001843: ACS request; acsRequestId="16d3f5fc2c60000" acsRequestName="Download" acsRequestCommandKey="16d3f5fc2c60000" 
 2019-09-17T13:18:24.226Z [INFO] 1.2.3.4 58D56E-Router-QXNN1IA001843: Script: SERIAL not valid: QXNN1IA001843 
 2019-09-17T13:18:24.238Z [INFO] 1.2.3.4 58D56E-Router-QXNN1IA001843: ACS request; acsRequestId="16d3f5fc2c60100" acsRequestName="GetParameterNames" 
 2019-09-17T13:18:24.289Z [INFO] 1.2.3.4 58D56E-Router-QXNN1IA001843: Script: SERIAL not valid: QXNN1IA001843 
 ==> /var/log/genieacs/genieacs-fs-access.log <== 
 2019-09-17T13:18:25.023Z [INFO] 1.2.3.4: Fetch file; filename="DIR_825_1.0.2.bin" 

GenieACS configs parameters

WORKER_PROCESSES

let workerCount = config.get(${service.toUpperCase()}_WORKER_PROCESSES);
if (!workerCount) workerCount = Math.max(2, require("os").cpus().length);

Define how many process are started/forked (default: 2 per CPU)

MAX_CONCURRENT_REQUESTS

Define how many concurrent requests are being handled (default 20)

PRESETS_CACHE_DURATION

You shouldn’t usually worry about this. Dig into the code if you need to know more “start with a grep -R PRESETS_CACHE_DURATION *”

TASK_PARAMETERS_BATCH_SIZE = GPV_BATCH_SIZE (= default 32)

How many GET PARAMETER VALUES per Request

źródło: http://lists.genieacs.com/pipermail/users/2019-February/002436.html