Skip to content

Instantly share code, notes, and snippets.

View sitchi's full-sized avatar
👽

Nikoloz Sitchinava sitchi

👽
View GitHub Profile
@sitchi
sitchi / mikrotik-ping-notification
Last active March 1, 2024 13:03
MikroTik check ping status and send SMS
# RouterOS script for pinging a list of addresses (sending SMS from UBILL API https://ubill.ge)
# Example
# Insert script: System > Scheduler > + Name=ubill-ping; interval=00:01:00;
# insert IP for monitoring: IP > Firewall > Address Lists > + Name=ubill-ping; Address=1.1.1.1; Comment=Router-Tbilisi;
:local ip;
:local disabled;
:local com;
/ip firewall address-list
@sitchi
sitchi / get_olt_info.php
Created April 22, 2020 21:26
telnet gets the MAC address and interface name from OLT - GPON/EPON
<?php
ini_set('max_execution_time', 0);
require_once 'telnetclass.php';
#$preg_onu_information = '/((EPON0\/[\d]{1,2}:[\d]{1,2})\s*(([A-Za-z]{3,4})\s*([0-9a-zA-Z]{3,4})){0,1}\s*([a-f0-9]{4}.[a-f0-9]{4}.[a-f0-9]{4})[\w\W]*(deregistered|auto_configured|auto-configured|lost)[\w\W]*(N\/A|power\soff|power-off|wire\sdown|unknow))+/iU';
#$preg_epon_optical_from_onu = '/((EPON0\/[\d]{1,2}:[\d]{1,2})\s*(-\d{1,2}\.\d))+/iU';
$preg_mac_address_table = '(([a-f0-9]{4}.[a-f0-9]{4}.[a-f0-9]{4})\s*(STATIC|DYNAMIC)[\w\W]\s*([g/e]?pon0(.*))\s)';