Friday, April 26, 2024

NETWORK CONFIG ON UBUNTU

 This has been changed since the last time I worked on ubuntu and now it totally differs from my debian knowledge. There is nothing complicated about it. The config file is just placed elsewhere and formulated differently. Then the network restart command and the networking system is also different. 

Back in the day it was the "if up if down" or "ifupdown" and now it is the Netplan service.

Check with this command which one are you running:

   dpkg -l | grep -E '(netplan|ifupdown)'


Check your card name with:

   ip a

Then edit your network file:

Instead of /etc/network/interfaces it is in a .yaml Netplan file

            # /etc/netplan/00-netcfg.yaml (config file location)
           
            network:         # start of network config block               
              version: 2     # use of Netplan version 2
              renderer: networkd     # system service provided by systemd
              ethernets:    # section of ethernet interface config
                enp0s3:     # interface logical name            
                   addresses:
                    - 192.168.1.40/24         # IP address and subnet mask
                   routes:                   
                    - to: default            # gateway, default
                     via: 192.168.1.254      # router ip
                   nameservers:
                    addresses: [8.8.8.8, 1.1.1.1]         # DNS server IPs

Then instead of systemctl restart networking.service
               
systemctl restart network-manager

We simply use:
    
netplan apply   

This is how simple it is still to configure a network card in linux / Ubuntu. You can find all info, very clearly explained here:

  • https://ubuntu.com/server/docs/configuring-networks

 _dnhyper

Tuesday, April 9, 2024

Probe your website with check_http and check_ping plug-ins /w NAGIOS

# Basically what you need is a specific character chain to read on a website, to make sure that
# it is up and running, just like we did with the Nagios browser.
# We are going to keep on checking and to keep an eye this site if it is reachable or if it has been changed.

# First we ensure that the SSL cert prerequisites are installed.
# make it ready for nagios user and nagioscmd user group
# then make it and install it


    apt-get install libssl-dev
cd /home/nagios/downloads/nagios-plugins-2.2.1/
    ./configure --with-nagios-user=nagios --with-nagios-group=nagcmd --with-openssl=/usr/bin/openssl
    make
    make install

# create a config file - I will check my own blog,
# being an ultra runner, that is one of the first websites in history

    

define host {
    host_name           leventedorogi.blogspot.com
    address             www.leventedorogi.blogspot.com
    check_command       check_ping!3000.0,50%!5000.0,80%
    max_check_attempts  3
}

define command {
    command_name    check-http-blog
    command_line    $USER1$/check_http -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -u $ARG3$ -s $ARG4$ -m $ARG5$ -p 443 -S
}

define service {
    service_description     HTTPS on myblog
    host_name               leventedorogi.blogspot.com
    check_command           check-http-blog!1!2!/2024/04//!'2024'!200
    max_check_attempts  3
}

# Basically what I did here is went onto a specific page in my blog
# and checked for the 2024 string on that page and till it is up,
# my page is up too, unchanged.
# We were a little lazy about giving all the obligatory arguments
# but it works. For the sake of testing, it is okay.
# Modify it to your needs.




_dnhyper

Monday, April 8, 2024

A simple router probe with check-ping Nagios plug-in

 

https://nagios-plugins.org/doc/man/check_ping.html

# A simple check_ping plugin for a router free-router.cfg
# -w 100.0,20%: warning threshold for response time to 100 ms with a
# packet loss threshold of 20%.

# If the response time exceeds 100 ms or the packet loss exceeds 20%,

# Nagios will generate a warning alert.
# -c 200.0,50%: critical threshold for response time to 200 ms with a
# packet loss threshold of 50%.
# If the response time exceeds 200 ms or the packet loss exceeds 50%,
# Nagios will generate a critical alert.

----------------------------------------------------------


define command {
    command_name    check_ping_command
    command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 100.0,20% -c 200.0,50%
}

define host {
    use             linux-server
    host_name       Free_Router
    alias           Free Router Device
    address         192.168.1.254
}

define service {
    use                     generic-service
    host_name               Free_Router
    service_description     Ping Check
    check_command           check_ping_command
}

_dnhyper

Sharepoint sync and lock issues - solutions

 Sharepoint synced down to your PC by onedrive can have a ton of errors. It is caused by the simple dis-functionality of this badly thought ...