Showing posts with label centos. Show all posts
Showing posts with label centos. Show all posts
Monday, March 21, 2016
Three steps get SNMP working on CentOS and RedHat
1. Install snmp with yum or other method
2. Configure
Backup and setup readonly user in config file
>mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org
>vi /etc/snmp/snmpd.conf
rocommunity public
syslocation “My Computer Room”
Restart Service
>service snmpd restart
Set Service to autostart
>chkconfig –list snmpd
snmpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
>chkconfig snmpd on
Open port in firewall if needed
>vi /etc/sysconfig/iptables
-A INPUT -p udp -m state –state NEW -m udp –dport 161:162 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 161:162 -j ACCEPT
Restart Firewall
>service iptables restart
3. Test
Network Setup in Linux
In Redhat and CentOS
Network interface cards are auto-discovered, they can be seen here;
/etc/udev/rules.d/ in the file 70-persistent-net.rules
View the File:
cat /etc/udev/rules.d/70-persistent-net.rules
cat /etc/udev/rules.d/70-persistent-net.rules
Output:
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# net device () (custom name provided by external tool)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:15:5d:xx:xx:xx”, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth1″
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:15:5d:xx:xx:xx”, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth1″
# net device () (custom name provided by external tool)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:15:5d:xx:xx:xx”, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:15:5d:xx:xx:xx”, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″
The network configuration files may also be auto created here:
/etc/sysconfig/network-scripts/ in the file ifcfg-ethXX
Subscribe to:
Posts (Atom)