View information about MySQL databases

To view information about MySQL databases and their tables, we first connect to the MySQL console, for example, as root:

mysql -u root

Or so, if you need to enter a password:

mysql -u root -p

Let’s see a list of existing databases:

SHOW DATABASES;

You can select a database like this:

USE dbname;

See which database is currently selected:

SELECT DATABASE();

To see which tables the selected database contains:

SHOW TABLES;

Example of viewing the contents of the specified table:

SELECT * FROM tablename LIMIT 25;

To view the structure of a particular table, execute the command:

DESCRIBE tablename;

Where Field is the name of the column, Type is the data type, Null – determines whether the column can contain NULL values, Key – whether the column is indexed, Default – determines the default value for the column.

To see information about the indexes of the table, you can do this:

SHOW INDEX FROM tablename;

View information about the table, the encoding, its type (ENGINES), etc. you can use:

SHOW CREATE TABLE tablename;

To see what types the server supports, you can do this:

SHOW ENGINES;

Changing the processor core frequency in Linux

To see the minimum, current and maximum frequency of the processor cores, execute the command:

grep '' /sys/devices/system/cpu/cpu0/cpufreq/scaling_{min,cur,max}_freq

For example, in my case, the following is displayed:

/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq:800000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:907482
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq:4000000

On idle servers, there is probably no point in raising the minimum frequency of the processor cores, but on heavily loaded ones, such as the access server for example, I usually increase, because the processor is constantly loaded, jumping frequencies only hinder and judging by the graphs after the changes, the load on the processor decreases noticeably.

To set the minimum frequency for all processor cores to the same as the maximum, create a script with the code below and execute it:

#!/bin/bash
cpucount=$(grep -c 'model name' /proc/cpuinfo)
sysdir=/sys/devices/system/cpu
for cpu in $(eval echo cpu{0..$((cpucount-1))}); do
        cat $sysdir/$cpu/cpufreq/scaling_max_freq > $sysdir/$cpu/cpufreq/scaling_min_freq
done

See also my article:
Changing CPU Scaling Governor on Linux

Monitoring the web site in Zabbix

Here is an example of setting up monitoring of a web site in Zabbix:

1) Select or add a network node for which we will observe.

2) Add to the Web site “Web Scenario”, specifying in the first tab:
Name: any
Agent: for example, Internet Explorer 11.0
in the “Steps” tab, add a step:
Name: any
URL: for example http://example.com
Required string: any string that is present on the site
Required status codes: 200

3) Add a graph for the created “Web Scenario” to see the download speed by selecting Download speed for scenario “example.com check”.

4) We add a trigger that will work after 3 unsuccessful attempts to access the site:
Name: any, for example “Site example.com is not available”
Importance: any
Expression:

{example.com:web.test.fail[example.com check].last(#3)}<>0

Done.

Configuring HTTP on Cisco

Connect to the Cisco switch and go into elevated privilege mode:

enable

Now go into the configuration mode:

configure terminal

Enable HTTP:

ip http server
ip http authentication local

If necessary, you can disable HTTP and HTTPS as follows:

no ip http server
no ip http secure-server

Add a user if it does not exist:

username NAME privilege 15 secret PASSWORD

If you want to allow HTTP access to only certain IPs, then let’s see what rules there are on the switch:

exit
show access-list
show ip access-lists
configure terminal

If there is no necessary rule, then we will create:

access-list 10 permit 192.168.1.22
access-list 10 permit 192.168.3.10

See my article – Restricting access to the Cisco Catalyst 6500 management

Apply the rule to HTTP:

ip http access-class 10

To cancel it is possible so:

no ip http access-class 10

If you need to specify the maximum number of connection attempts:

ip admission max-login-attempts 5
show ip admission configuration

Leave their configuration mode and save the configuration:

exit
write

See also:
Configuring Cisco devices

SNMP OID for Teleste Luminato

Download the MIB archive by opening the Teleste Luminato web interface and selecting “Administration” – “Services” – “SNMP” – “Download MIBs”.
To get an OID from a MIB, you can use a converter, for example “Paessler MIB Importer and Converter”.

You can check the OID from Linux with the following command:

snmpwalk -v2c -c community 192.168.1.2 OID

Below is a list of some OIDs.
general:
1.3.6.1.4.1.3715.17.1.1.0 (device name)
1.3.6.1.4.1.3715.17.1.10.0 (hw serial number)
1.3.6.1.4.1.3715.17.1.11.0 (hw type)
1.3.6.1.4.1.3715.17.1.12.0 (hw version)
1.3.6.1.4.1.3715.17.1.13.0 (sw version)
1.3.6.1.4.1.3715.17.1.14.0 (up time)
1.3.6.1.4.1.3715.17.1.15.0 (cumulative uptime)

module:
1.3.6.1.4.1.3715.99.2.1.1.1.1 (module id)
1.3.6.1.4.1.3715.99.2.1.1.1.2 (module name)
1.3.6.1.4.1.3715.99.2.1.1.1.3 (module hw type)
1.3.6.1.4.1.3715.99.2.1.1.1.5 (module slot no)
1.3.6.1.4.1.3715.99.2.2.1.1.3 (status internal temperature, 0.1 C)

hr storage:
1.3.6.1.2.1.25.2.3.1.1 (hr storage index)
1.3.6.1.2.1.25.2.3.1.2 (hr storage type)
1.3.6.1.2.1.25.2.3.1.3 (hr storage descr)
1.3.6.1.2.1.25.2.3.1.4 (hr storage allocation units)
1.3.6.1.2.1.25.2.3.1.5 (hr storage size)
1.3.6.1.2.1.25.2.3.1.6 (hr storage used)
1.3.6.1.2.1.25.2.3.1.7 (hr storage allocation failures)

status code device:
1.3.6.1.4.1.3715.17.2.2.1.1 (scd object id)
1.3.6.1.4.1.3715.17.2.2.1.2 (scd object value)
1.3.6.1.4.1.3715.17.2.2.1.3 (scd object descriptor)
1.3.6.1.4.1.3715.17.2.2.1.4 (scd object alarm value)

status code module:
1.3.6.1.4.1.3715.17.2.3.1.1 (scm module id)
1.3.6.1.4.1.3715.17.2.3.1.2 (scm object id)
1.3.6.1.4.1.3715.17.2.3.1.3 (scm object value)
1.3.6.1.4.1.3715.17.2.3.1.4 (scm object descriptor)
1.3.6.1.4.1.3715.17.2.3.1.5 (scm object alarm value)

status code interface:
1.3.6.1.4.1.3715.17.2.4.1.1 (sci interface id)
1.3.6.1.4.1.3715.17.2.4.1.2 (sci object id)
1.3.6.1.4.1.3715.17.2.4.1.3 (sci object value)
1.3.6.1.4.1.3715.17.2.4.1.4 (sci object descriptor)
1.3.6.1.4.1.3715.17.2.4.1.5 (sci object alarm value)

etc.

See also:
SNMP MIBs and OIDs

Using third-party SFP modules in Cisco switches

Suppose we connected a third-party module to the first SFP port, we’ll look at the information about it:

show idprom int GigabitEthernet 1/1

In my case, on the Cisco Catalyst 6509-E, very many ports with third-party SFP modules after some time they turned off and in the logs information was written that the module was not supported.

Now go into the configuration mode:

enable
config t

And we will make sure that the interfaces are not disabled when third-party SFP modules are enabled by entering the following commands:

service unsupported-transceiver
no errdisable detect cause sfp-config-mismatch
no errdisable detect cause gbic-invalid

After that, everything worked well.

See also:
Configure Cisco Catalyst 6509-E

Configuring TP-Link EP110

On the test I will connect TP-Link EP110 ONT to BDCOM P3310B-2AC EPON OLT.

To configure the TP-Link EP110, you must connect it to the computer with a cable and type in the address bar of the browser http://192.168.1.1, then disable the DHCP server from the menu by unchecking DHCP.

It is also necessary to select the ONT mode as shown in the figure below:
tp-link-ep110

After that, TP-Link EP110 will work and register similarly to other ONTs, such as BDCOM P1501C1, FOXGATE 1001w, etc.

See also:
Configuring the BDCOM P3310 EPON

Manuals for Huawei SmartAX MA5xxx

SmartAX MA5621 Configuration Guide (V800R309C00_02)
https://drive.google.com/open?id=1arUtO98ri36CKYdQztVNIM6Tj0xsQdux
File size: 2.2Mb
Pages: 202

SmartAX MA5600T/MA5603T Commissioning and Configuration Guide
https://drive.google.com/open?id=1mfzH8RHSTB3o-HGhUMMcfEEMxnsLR_qa
File size: 9.6Mb
Pages: 1130

SmartAX MA5600 0031162100 Руководство по эксплуатации – Основные операции
https://drive.google.com/open?id=1v-DjsJcGASHuo4GsBBc-U-TQmgEfoXuf
File size: 10.9MB
Pages: 442

SmartAX MA5621 Smart Grid GPON Solution Configuration Guide 01
https://drive.google.com/open?id=1zZJqVnfAdRv_gShe18h6pahKdVYe-2Wv
File size: 0.7Mb
Pages: 52

SmartAX MA5300 31161292 Operation Manual
https://drive.google.com/open?id=1LFCYFi7JcK3kwVQqZneAMNCwaCIM39GP
File size: 4.2Mb
Pages: 501

See also:
Huawei MA5600T & MA5603T Configuration Guide