Mostrando postagens com marcador snmp. Mostrar todas as postagens
Mostrando postagens com marcador snmp. Mostrar todas as postagens

SNMP Oracle Linux

 

sudo yum install net-snmp net-snmp-utils -y 

 

nano /etc/snmp/snmpd.conf 

agentAddress  udp:10.20.1.2:161
rocommunity public

systemctl restart snmpd
 

Snmpd Listen to Specific IP Address - CentOS

 

vi /etc/sysconfig/snmpd.options

OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a -x 127.0.0.1 192.168.1.254"

service snmpd reload

 

 

Enable Service in centos 9 firewall (firewalld)

 

    1. Add a profile for SNMP to firewalld.
      nano /etc/firewalld/services/snmp.xml

      Contents of the file is as following (Please mind the using of udp port 161)

      <?xml version="1.0" encoding="utf-8"?>
      <service>
      <short>SNMP</short>
      <description>SNMP protocol</description>
      <port protocol="udp" port="161"/>
      </service>
    2. Reload your firewall for checking any error
      firewall-cmd --reload
    3. Add the service to your public zone
      firewall-cmd --zone=public --add-service snmp --permanent
    4. Reload your firewall again
      firewall-cmd --reload

Now Test Snmp Status from another server

snmpwalk -v 2c -c public IP.of.target.server
 
 

ESXI enalbe SNMP

 Run through ssh (it's  all in one line)

esxcli system snmp set -r && esxcli system snmp set -c COMMUNITY && esxcli system snmp set -p 161 && esxcli system snmp set -C CONTACTA_MAIL && esxcli system snmp set -L "LOCATION" && esxcli system snmp set -e yes
 

ESXI CLI

Activate SNMP on VSphere client
Configuration -> Security Profile -> Firewall -> Properties -> SNMP


Connect to ESXI using SSH and run the command below, changing community, contact email and location:

esxcli system snmp set -r && esxcli system snmp set -c public && esxcli system snmp set -p 161 && esxcli system snmp set -C contact@domain.com && esxcli system snmp set -L "City, State" && esxcli system snmp set -e yes


#firewall all hosts
esxcli network firewall ruleset set --ruleset-id snmp --allowed-all true
esxcli network firewall ruleset set --ruleset-id snmp --enabled true
#firewall for specific network
esxcli network firewall ruleset set --ruleset-id snmp --allowed-all false
esxcli network firewall ruleset allowedip add --ruleset-id snmp --ip-address 10.20.0.0.0/23
esxcli network firewall ruleset set --ruleset-id snmp --enabled true
#restart snmp
/etc/init.d/snmpd restart 



Set time:
esxcli system time set -d 31 -M 1 -y 2012 -H 18 -m 0 -s 0

source: https://kb.vmware.com/s/article/1003736


View log in browser:

https://server_ip_or_name/host/syslog.log





Apt only upgrade selected packages

 apt list --upgradable | cut -d"/" -f1 > /tmp/apt pico /tmp/apt cat /tmp/apt | tr "\n" " " apt install --on...

Mais vistos