In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
1. Whether the snmp and the network are normal
By running snmpwalk-c public-v 2c ip on the cacti server, you can return data normally and troubleshoot snmp and network problems.
Note:-c followed by the community name public is the community name, which can be changed here and needs to be changed according to your own environment settings!
-v snmp version
Ip is the IP of the monitored end
2. View cacti global parameter settings
There is no problem with the path and collector in the global parameter setting of cacti.
Check the directory permissions of rra and log on the cacti server
Check that the rra and log directories are both users of the web program, and have read and write permissions to the rra and log directories, no problem. Enter the rra directory and find that the modification dates of all image files are from a few days ago, that is to say, no data has been obtained recently and updated to the rra file; when entering the log directory, it is found that the cacti.log file reaches 2G mv cacti.log cacti.log.old log does not record things, mv cacti.log cacti.log.old, regenerate cacti.log, the fault is still the same.
4. Check cacti.log
Snmp can get data, and there is no problem with rra and log permissions, so why can't you get the data yet?
Open the detailed log in the global settings of cacti, and tail-f cacti.log view the log and find that there are many similar logs:
WARNING: Result from CMD not valid. Partial Result:
This is because the cacti collector did not get the return data of the relevant host. At the same time, the following logs are found:
Maximum runtime of 292 seconds exceeded. Exiting.
It means that in a cycle (5min), cacti does not get all the data and automatically exits and executes the next cycle.
There should be too many hosts, and many hosts can not connect to the timeout, resulting in the final collector time exceeding 292s to automatically exit.
Decided to use cactid instead of cmd.php collection, while cleaning the database of invalid poller_item, unable to connect, misconfigured records (important, you can know which hosts or records have problems according to cacti.log).
5. Configure cactid
The new version is called spine. Install and configure cactid:
Tar-zxvf cacti-cactid-0.8.6j.tar.gz
Cd cacti-cactid-0.8.6j
. / configure (the additional installation of mysql refers to the Ann mysql path)
Make
Mkdir / usr/local/cactid
Cp cactid cactid.conf / usr/local/cactid/
Vi / usr/local/cactid/cactid.conf is changed to the username and password of the corresponding database.
In the global configuration, set the collector to cactid, and set the path of cactid: / usr/local/cactid/cactid
Now that you can get the data normally, check cacti.log:
02 CACTID 11:31:03 AM-CACTID: Poller [0] Time: 55.2049 s, Threads: 1, Hosts: 25
...
02 CACTID 11:32:04 AM-CACTID: Poller [0] Time: 113.7014 s, Threads: 1, Hosts: 25
All the host data can be obtained in two minutes, and the efficiency is greatly improved. The problem is solved.
6. If the above can not solve the problem, you can run it manually: php / var/www/html/cacti/poller.php to check the output to find the problem.
= =
Graphics cannot be displayed during cacti installation testing: (2011-09-13)
Cd / var/www/html/cacti/log
Tail-f cacti.log
The display is as follows:
09Universe 01:10:03 PM-SYSTEM STATS: Time:1.4293 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:17 RRDsProcessed:11
01:14:01 PM-CMDPHP: Poller [0] Host [1] DS [11] WARNING: Result from CMD not valid. Partial Result: U
01:14:01 PM-CMDPHP: Poller [0] Host [1] DS [11] WARNING: Result from CMD not valid. Partial Result: U
The process is as follows:
The final solution is to use cmd.php as chmod axix.
Later: at that time, I felt very strange. Poller.php had already assigned php to run. Later, I thought that maybe I called cmd.php directly in poller.php, not just php script.
= = troubleshooting experience of cacti =
Cacti is unable to produce data, and generally solves the problem from the following aspects
one. Confirm whether the snmp data on the target machine can be obtained on your cacti host
There are two ways for cacti to get the statistical data on the target machine, one is obtained remotely through the snmp protocol, and the other is obtained by the local machine through the shell script.
two. Make sure your crontab planning tasks are working properly.
Cacti acquires data at regular intervals through crontab's timed job. If the timed job does not work, the data will certainly not be read.
three. Make sure that the jobs executed by your crontab scheduled jobs can get information.
Cacti uses poller.php to get information regularly, and then according to whether you set up a php script to execute snmp or cactid to get, so you must make sure that your php can support php's snmp extension, or that you have set up cactid correctly. It is recommended to use cactid, which is 10-20 times more efficient than through php.
four. Confirm the version of your rrdtool
There is a big difference between the rrdtool1.0.x version and the 1.2.x version, so set your rrdtool version correctly in cacti. More prone to errors is that your rrdtool is 1.2.x version, and the default rrdtool version of cacti is 1.0.x version, if this is the case, your data collection is normal, but due to changes in the rrdtool version of the command processing format of a little difference, cacti thumbnails can not be drawn, and specific pictures can be drawn out, this, we should pay attention.
five. Of course, make sure that the data collected by cacti can be stored on your machine, and that the collected data can be read by httpd services.
The above is some of my personal understanding of cacti's trouble shooting, please add and correct.
When you install cacti and configure it as an example, you will often encounter a lot of problems when you think of getting the first example like hellow world. The most likely problem is that there are no diagrams or no data.
First say no map, mainly check to make sure that your IP address, snmp comunite, snmp version and other information configuration is not wrong, if there are no errors, then you are sure to collect only one cycle (usually the default collection cycle of 300s) to check the rra directory later to see if there is a corresponding rra file generated, if it is a new installation, the original rra directory only has a .placeholder file. All you have to do is pay attention to the files with the suffix rra. If there is no rra file permission, windows is ntfs and linux have this problem, others check the settings of snmp.
Solve the problem of no graph or no data in cacti snmpwalk-v 2c-c public yourIP if
If any data is returned, there is no problem with the data in snmp. If "Timeout: No Response from..." appears. An error message like this is a problem with snmp settings.
In addition, there are pictures but no data. Generally speaking, there is a problem with the results collected by snmp. In this case, it will also occur that the status in the Data Query of the newly created device is always "Success [0 Items, 0 Rows]". Check by executing the snmp command:
Snmpwalk-c community-v 2c hostIP if
From the results, you can see whether cacti is allowed to fetch the data of these OID.
Eg:
Snmpwalk-c public-v1 192.168.0.221 .1.3.6.1.1.2.2.2.1.16.2
When cacti has a graph but no data, and the status is nan error solution:
1.
[root@codfei rra] # pwd
/ usr/local/apache2/htdocs/cacti/rra
[root@codfei rra] # rrdtool fetch fxd-mdl11_traffic_in_365.rrd AVERAGE
Follow the above command if the result output is:
1197990600: nan nan
1197990900: nan nan
1197991200: nan nan
1197991500: nan nan
1197991800: nan nan
1197992100: nan nan
It means that there is a problem with snmp obtaining data. After careful inspection, it is found that the hosts that cannot obtain traffic are all 64-bit systems.
Check with the following command:
[root@codfei rra] # snmpwalk-c public-v 2c 192.168.1.2 IF-MIB::ifHCInOctets
The output is as follows, indicating that the 64-bit MIB library is not supported, and finally found the reason.
IF-MIB::ifHCInOctets = No Such Object available on this agent at this OID
2. You need to reinstall snmpd to support 64-bit MIB libraries, but error will appear when you install make with the source package, so you cannot continue.
Solution:
After config in the source code package, do not make first, please modify the following two files first.
[root@codfei net-snmp-5.3.1] # vi apps/Makefile
TRAPDWITHAGENT = $(USETRAPLIBS)-ldl-lrpm-lrpmio-lpopt-lz-lcrypto-lm
To be replaced by:
TRAPDWITHAGENT = $(USETRAPLIBS)-ldl-lrpm-lrpmio / usr/lib64/libpopt.so-lz-lcrypto-lm
[root@codfei net-snmp-5.3.1] # vi agent/Makefile
LIBS =.. / snmplib/libnetsnmp.$ (LIB_EXTENSION) $(LIB_VERSION)-ldl-lrpm-lrpmio-lpopt-lz-lcrypto-lm $(PERLLDOPTS)
To be replaced by:
LIBS =.. / snmplib/libnetsnmp.$ (LIB_EXTENSION) $(LIB_VERSION)-ldl-lrpm-lrpmio / usr/lib64/libpopt.so-lz-lcrypto-lm
And then make & & make install
3. Stop the snmpd that comes with the current linux and start the newly installed snmpd through daemoonls.
At this time, snmpwalk detection is used, 64-bit MIB library is supported, and the picture of traffic monitoring comes out after a while!
[root@codfei rra] # snmpwalk-c public-v 2c 192.168.1.2 IF-MIB::ifHCInOctets
IF-MIB::ifHCInOctets.1 = Counter64: 2400309170
IF-MIB::ifHCInOctets.2 = Counter64: 256326257624
IF-MIB::ifHCInOctets.3 = Counter64: 0
IF-MIB::ifHCInOctets.4 = Counter64: 624808037429
IF-MIB::ifHCInOctets.5 = Counter64: 0
IF-MIB::ifHCInOctets.6 = Counter64: 0
IF-MIB::ifHCInOctets.7 = Counter64: 0
IF-MIB::ifHCInOctets.8 = Counter64: 0
Problem solving of Cacti Monitoring remote Server
Use the template ucd/net-Memory Usage to check other machines in the LAN and find that there are pictures, but no data. They are all nan.
Cacti log has the following error
02:10:08 AM-CMDPHP: Poller [0] Host [7] DS [44] WARNING: Result from SNMP not valid. Partial Result: U
02:10:08 AM-CMDPHP: Poller [0] Host [7] DS [43] WARNING: Result from SNMP not valid. Partial Result: U
02:10:08 AM-CMDPHP: Poller [0] Host [7] DS [42] WARNING: Result from SNMP not valid. Partial Result: U
02:10:08 AM-CMDPHP: Poller [0] Host [7] DS [41] WARNING: Result from SNMP not valid. Partial Result: U
02:10:08 AM-CMDPHP: Poller [0] Host [7] DS [40] WARNING: Result from SNMP not valid. Partial Result: U
02:10:08 AM-CMDPHP: Poller [0] Host [7] DS [39] WARNING: Result from SNMP not valid. Partial Result: U
So
Wget ftp://mirror.switch.ch/pool/1/mirror/scientificlinux/5rolling/i386/SL/net-snmp-utils-5.3.1-24.el5_2.1.i386.rpm
Install to get snmpget snmpwalk snmpbulkwakl snmpgetnext
Snmpwalk-v 2c-c public your_remote_ip if
Error:
Timeout: No Response from your_remote_ip
So modify the snmpd configuration and start snmpd
Com2sec notConfigUser default public--- > com2sec notConfigUser your_snmpd_server_ip public
# view all included. 180 view all included-> view all included. 180
Snmpwalk-v 2c-c public your_remote_ip system ok
But...
Snmpwalk-v 2c-c public your_remote_ip if
Error:
IF-MIB::ifTable = No Such Object available on this agent at this OID
So modify snmpd.conf again and restart snmpd
Access notConfigGroup "" any noauth exact systemview none none-- >
Access notConfigGroup "" any noauth exact all none none
Snmpwalk-v 2c-c public your_remote_ip if again
Ok
Visit the page again, and finally the picture and data come out.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.