In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Following the previous blog post cacti configuration installation, the next talk about some operations on cacti self-developed templates. Log in to the virtual host you set up. In the previous article, I set up the virtual host as cacti.gaowei.com. The first time you log in, you will be prompted to install cacti, step by step according to the prompts, the default username and password is admin and admin, after logging in, you will be asked to change your password. The interface after installation is as follows;
Click graphs, there are five default templates, you can detect the status of the host, as follows;
Not much to say here, specifically how to develop templates, open the machine in the end, enter
#cd /web/vhost/cacti-0.8.8a/scripts
#vim tcp3c.sh items you want to detect, e.g.
#!/ bin/bash
#
#$1:hostname or IP
#$2:snmp community
SNMPNETSTAT=/usr/bin/snmpnetstat
TEMPFILE=`mktemp /tmp/$1_tcpconn.XXXXXXXX`
$SNMPNETSTAT -v 2c -c $2 -Can -Cp tcp $1 > $TEMPFILE
ESTABLISHED=`grep -i "ESTABLISHED" $TEMPFILE | wc -l`
TIMEWAIT=`grep -i "TIMEWAIT" $TEMPFILE | wc -l`
SYNRECEIVED=`grep -i "SYNRECEIVED" $TEMPFILE | wc -l`
echo -n "established:$ESTABLISHED timewait:$TIMEWAIT synreceived:$SYNRECEIVED" //script intercepts tcp3 status messages.
Let's start developing templates for these three projects and enter the cacti front-end interface.
Click Date Input Methods and click add again in the upper right corner.
Then fill in the following information:
Let me explain the information here;
First of all, the first column is the name of the template, which can be written freely. In the second column, the option is the way to enter data. Here we enter it in the form of script, so we choose script here. The third column is the script execution method. The script written here is a shell script executed with bash, so first write/bin/bash, then the path of the script, which is the variable inside cacti. This is the path of cacti installation. For parameters, the script here requires parameters.
After this is written, the following two options will also need to be set, as follows;
Click add of input fields. Here is the setting for adding script parameters. The settings are as follows:
The first column contains the parameters previously set in date input methods, starting with hostname. The second column contains the alias of the first column, whatever. Leave the third column alone. In the fourth column are the keywords that are valid for the following data entry methods. Here, choose hostname. Remove the check mark of allow empty input and save it after setting.
The setting of the second parameter is similar to that of the previous parameter.
Here is the parameter setting, then start setting output fields, click add, as follows;
Here I screenshot the established options for the three items detected. The settings in the first column must be consistent with the script output. The next column is alias, whatever. Save after modification.
The remaining two detection items are not much to say, directly above the figure;
At this point, the date input methods option has been fully set and can be saved.
Next is to set the second big option, date templates, set the data input method, you must set the corresponding data template, click date templates, as shown in the figure:
Click add in the upper right corner, as shown in the figure;
Here is the template I added myself. Let me explain. The first column is the template name. The second column is also the name. This option can be written with reference to other templates. Almost all Mo versions are||- The format starts with this reference to other templates. The third column selects the previously set data input method. In the fourth column, select everything except the first option. Default in column 5.
Next is the date source item, the data source option, here is the item we monitor, the first column is the name of the internal data source, random, the second blue and the third column are the maximum and minimum values, as shown in the figure, the fourth column is the way the data is sorted. Related knowledge of rrdttool. The fifth column defaults, and the sixth column selects the corresponding output field. Select Save after setting. This is only a monitoring project, you need to add two more projects, click the date source item to its new, continue to add, do not say more. After setting up all monitoring items, click Save at the bottom.
Start setting the third big option, click Date Source to add data sources, as shown in the figure;
Click add on the right, as shown in the figure:
As shown in the figure, the first blue selects the data template we set, and the second blue selects the local machine. At this time, the third column will automatically generate the.rrd file. Here, you can modify the name, or you can save it directly. The third major project was completed.
Then start setting the fourth big option, click graph templates, as shown in the figure:
Click add in the upper right corner, as shown in the figure;
Here I set it to:
The first column name is random, the second column refers to other templates, other options default, the last line vertical label, random. Click Create after setting.
After saving, continue to add items inside, as shown in the figure:
Click add on the right to add the item to be monitored to the image template, as shown in the figure:
Here is an item I added, here to explain, the first column is to select the data source, that is, set before, the second column is to select the color, the third column is the default, the fourth column is the image type, is it linear or regional, the fifth column is the type of data collection, here you must select average. The last column is legend, which can set its own name, this is the monitoring label, the rest of the default. Click Create.
After that, click add. Here, different data acquisition types should be set for the same data source, as shown in the figure:
Here, the first column is still the data source established. In the fourth column, you must select gprint. In the fifth column, you can select the type of data collection. This time, you can choose current, average, etc. The last column is the item of legend. This is a random name. If it is the current value, write current: , average: , etc., and other defaults. Click Create. The data collection type I created here is the current value. I won't talk about the average value and the maximum value. I will go directly to the figure above.
Repeat the established adding steps for the remaining two data sources. After all data sources are added, be sure to click Save. I won't talk about it here. At this point, the fourth big option was finished.
Next is the setting of the fifth big option, add the set graphic template to the graphic tree, click graph management, and click add, as shown in the figure:
The first column selects the set graphic template, the second column selects the local computer, and the remaining three columns select the corresponding graphic items of the data source at once. Click Save. The fifth option is also complete. This is also the last option. Click on the graph icon in the upper left corner. You can see the set graphics, directly above the picture;
At this point, my custom template is complete.
Thank you!
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.