Installing SNMP
Http://www.zijidelu.org/thread-7479-1-1.html
Yum Install Net-snmp net-snmp-devel net-snmp-utils
CentOS Install SNMP
Install NET-SNMP
CentOS and other Redhat series products provide a NET-SNMP binary package. We can install it directly from the source.
Yum Install Net-snmp net-snmp-devel net-snmp-utils
Copy Code
Description: Net-snmp-devel is to use Net-snmp-config, Net-snmp-utils is to use Snmpwalk
Configure NET-SNMP
The NET-SNMP under CentOS cannot use V3 normally in selinux environment. If you want to use SNMP v3, disable SELinux first.
Net-snmp-config--create-snmpv3-user-ro-a snmp@jiankongbao-a MD5 Jiankongbao
Copy Code
Above command, create a Snmpv3 user, read only, use MD5, username is Jiankongbao, password is Snmp@jiankongbao.
Note: Please deactivate the NET-SNMP service before running.
Service SNMPD Stop
Copy Code
Run NET-SNMP
The method of running the NET-SNMP service is simpler, but the name of the NET-SNMP service is SNMPD
Service SNMPD Start
Copy Code
You may need to add it to the Power-on Autorun service list.
Chkconfig snmpd on
Copy Code
Detect NET-SNMP
We can use Snmpwalk to detect if the SNMP service is turned on properly.
Snmpwalk-v 3-u jiankongbao-a md5-a "Snmp@jiankongbao"-l authnopriv 127.0.0.1 SYSDESCR
Copy Code
Configuring the Iptables Firewall
NET-SNMP uses UDP protocol, port 161. Add the following rules to the/etc/sysconfig/iptables
-A rh-firewall-i input-p udp-s 60.195.249.83--dport 161-j ACCEPT
-A rh-firewall-i input-p udp-s 60.195.252.107--dport 161-j ACCEPT
-A rh-firewall-i input-p udp-s 60.195.252.110--dport 161-j ACCEPT
Copy Code
Start how to add are blocked by the firewall, with this rule can pass
Cacti the default username and password are admin
Change the password when you log in
Error 1:php Warning:date (): It isn't safe to rely on the system ' s timezone settings
By observing the error logs of Nginx, a large number of the following errors were found:
PHP warning:date (): It isn't safe to rely on the system's timezone settings. You are are *required* to use the Date.timezone setting or the Date_default_timezone_set () function. In case you are used any of those methods and your are still getting this warning, for you most likely misspelled the timezone Iden Tifier. We selected ' asia/chongqing ' for ' cst/8.0/no DST ' instead in
By searching, it is found that from php5.3, when a function such as the date () is used, a e_notice or e_warning information is generated when the timezone is set incorrectly and every time function is invoked. Know the root cause of the problem, there are three ways to solve, any choice can be.
First, in the page using Date_default_timezone_set () Set Date_default_timezone_set (' PRC ');
Second, the use of Ini_set (' Date.timezone ', ' Asia/shanghai ') in the head of the page;
Third, modify the php.ini. Open Php5.ini Find Date.timezone Remove the preceding semicolon modify to become: Date.timezone =PRC
Note: The above settings are set for mainland China, and PRC can also be replaced with Asia/shanghai,asia/chongqing,asia/urumqi.