Entries Tagged as 'Network'

用cacti画多个设备的总流量图(Aggregating traffic of multi devices into one graph)

最近有需求,要了解业务线所用的流量

于是想到用cacti画一张业务线所有机器所用流量和的总流量图

本来cacti已经有每一台设备的流量图(数据)了

现在所要做的就是把需要的数据加起来,画在一张图上

我只知道这个东西做起来应该不难

但由于大家以前都习惯用mrtgcacti这个东东的中文资料不多

所以我最后在cacti的官方论坛forum.cacti.net 上翻出了这么一篇类似的解决方案

http://forums.cacti.net/post-42426.html

下面这是原文:

1. Create a new CDEF - Management/Graph Management/CDEFs:
- Click 'Add'
- Create as per the 2nd image above

2. Create a new Graph - Management/Graph Management:
- Click 'Turn Off Graph Debug Mode'
- Click 'Add'
- Leave 'Selected Graph Template' and 'Host' as 'None'
- Click 'create'
- Give your graph a destinctive title and click 'create'
- Add the first data source by clicking 'Add' beside 'Graph Items'
- select your first data source
- select your colour
- in 'Graph Item Type' select 'Area'
- in 'CDEF Function' select 'Bytes into bits'
- give the data source a title
- Click 'create'
- Click 'add' again and create a legend (all values the same as above, except 'Graph Item Type' is 'Legend')
- Add your second data source exactly at the first except 'Graph Item Type' is 'Stack'
- add legend for second data source as above
- Continue adding sources in the same fashion until you are done.

To get the total on the graph, add another Graph Item:
- use the same data source as your last data source
- select your colour
- in 'Graph Item Type' select 'Line 3' (use Line 2 or Line 1 for smaller lines)
- in 'CDEF Function' select 'Total All Data Sources and Bytes into Bits' (the one you created at the start)
- In Text Format, call it 'Total'.
- Click 'create'
- Click 'add' again and create a legend (all values the same as above, except 'Graph Item Type' is 'Legend')

Now you should have a graph with the output from different data sources, plus a total at the bottom.

 

这里作者应用的建CDEF的图我没有贴出来

其实就是新建一个名字叫“Total All Data Sources and Bytes into Bits”的CDEF,其

cdef=SIMILAR_DATA_SOURCES_NODUPS,8,*

这里的意思我想是把流量(bytes为单位)变成以bites为单位的流量

然后再建一张新的图

在新图的"graph items"里把要统计的数据(这里是网络设备的流量)"Add"进来

最后再添加一个"graph item"

用来画总流量曲线

他的Data Source就用上面最后一个graph itemData Source

CDEF function选开始建的"Total All Data Sources and Bytes into Bits"

(前面的graph itemCDEF function都选"Turn Bytes into Bits",他的cdef值是

cdef=CURRENT_DATA_SOURCE,8,*

Graph Item TypeLine1(Line2Line3都行,就是线条的粗细不一样)

(前面的graph item除了第一个选area外,都选stack

同样

还有个需要注意的:

就是每添加上面所讲的一个“graph item

还需要接着添加一个跟其匹配的"graph item"

这个"graph item"除了Graph Item Type选"legend"外其他都跟其匹配的"graph item"相同

 

 

sun fire v20z机器的远程管理

公司机房有2台巨强的sun fire v20z的机器

这个机器也有远程管理口

一直以来也不知道怎么用的

直到今天出了点事情

如果有远程管理的话就可以不去机房

但是……

所以痛定思痛

我翻了下文档把远程管理配上了

这里是文档,文档来自http://www.sun.com/products-n-solutions/hardware/docs/html/817-5246-16/chap2.html#pgfId-999743

Configuring the Service Processor


The Sun Fire V20z and Sun Fire V40z servers include a dedicated SP for complete server independence and maximum availability of server management. The SP is an embedded PowerPC that provides the following functions:

  • Environmental monitoring of the platform (such as temperatures, voltages, fan speeds and panel switches)

     

  • Alert messages when problems occur

     

  • Remote control of server operations (boot, shutdown and reboot of the server’s operating system, turning the server’s power on and off, stopping the server’s boot process in BIOS, and upgrading BIOS)

     

After supplying AC power to the server, you are ready to begin configuring the SP by setting an IP address and associated network settings for the SP. You can configure the SP network settings by using DHCP or by using a static IP address.

Defining SP Network Settings

This section contains two alternate methods you can use to define SP network settings:

Assigning SP Network Settings Using DHCP

The following procedure describes how to set the SP network settings using DHCP from the Operator Panel. If your network does not use DHCP, or you want to assign a static IP address to the SP, follow the instructions in Assigning Static SP Network Settings.

1. Press any operator panel button on the server front panel (see FIGURE 2-1).

The LCD panel displays the first menu option:

Menu:

Server Menu


FIGURE 2-1 Operator Panel Buttons



2. Press the Forward button until you reach the SP menu:

Menu:

SP menu

3. Press the Select button to display the SP menu options.

SP Menu:

Set SP IP info?

4. Press the Select button.

The following prompt appears with the default response:

SP use DHCP?

No

5. Press the Forward button to change to Yes, then press the Select button.

6. Press the Select button at the confirmation prompt.

SP use DHCP:

Yes?

The server attempts to contact a DHCP server for an IP address. When the server receives a DHCP response, the LCD panel displays the DHCP-assigned SP IP addresses. The SP address is configured and the server is ready for use.




7. Continue with Creating the Initial Manager Account for instructions on creating the initial manager account.


Assigning Static SP Network Settings

From the operator panel, follow these steps to set the SP network settings using a static IP address. You must specify a subnet mask and default gateway. This example uses the following sample settings:

IP Address: 10.10.30.5

Subnet Mask: 255.255.255.0

Default Gateway: 10.10.30.254

1. Press any operator panel button on the server front panel (see FIGURE 2-1).

The LCD panel displays the first menu option:

Menu:

Server Menu

2. Press the Forward operator panel button until you reach the SP menu:

Menu:

SP menu

3. Press the Select operator panel button to display the SP menu options.

SP Menu:

Set SP IP info?

4. Press the Select operator panel button. The following prompt displays with the default response:

SP use DHCP?

No

5. Press the Select operator panel button.

The LCD displays as follows:

SP IP Address:

0.0.0.0

6. With the cursor in the first field, increase or decrease the value using the Back or Forward operator panel button.

This field can hold a value between 0 and 255.

SP IP Address:

10.0.0.0

7. After reaching your desired value, press the Select operator panel button to advance the cursor to the next field.

SP IP Address:

10.0.0.0

8. Repeat Step 6 and Step 7 for each field until the desired IP address is displayed, then use the Enter button combination to save the IP Address.

The process continues to the next network setting, the Subnet Mask. The LCD displays as follows:

SP netmask:

255.255.255.0

9. Edit the subnet mask setting in the same manner as you did for the IP address. When finished, use the Enter button combination to save the subnet mask.

The process continues to the next network setting, the default gateway. The LCD displays as follows:

SP IP Gateway

10.10.30.1

10. Edit the default gateway setting in the same manner as you did for the IP address and the subnet mask. When finished, use the Enter button combination to save the default gateway.

The LCD displays the following confirmation prompt:

Use new IP data:

Yes?

11. Press the Select operator panel button to use the new data, or use the Cancel button combination to disregard.

The SP address is now configured and the server is ready for use.


12. Continue with Creating the Initial Manager Account.

Creating the Initial Manager Account

After you install the server and configure the SP’s network settings, you must create the initial manager account. You can then perform initial configuration of the server and create additional user accounts. Only the administrator who does the initial system configuration can create the initial manager account.

A setup account is included with each server. This setup account has no password. When you log in to the SP the first time using the setup account, you are prompted to define the initial manager account with a password and an optional public key.

Usernames and passwords are strings that consist of any alphanumeric character, underscore, hyphen, or period.

  • Usernames must be unique and must begin with an alphabetic character.

     

  • Passwords can contain any printable character and are case-sensitive.

     

  • A username or a password is limited to 32 characters and cannot be a null or an empty string.

     

There are two methods you can use to create the initial manager account:

Creating the Initial Account From a Command Line

Log in to the setup account and create the initial manager account by following this procedure:

1. Using an SSHv1 or SSHv2 client, connect to the IP address of the SP.

2. Authenticate as the user setup with no password required:

# ssh sp_ip_address -l setup

3. Follow the on-screen prompts to create the initial manager account.

After you create the initial manager account, the setup account is deleted and you are logged out of the server. You can then log in using the new initial manager account, from which you can create other user accounts.


After you create the initial manager account, continue with Defining a Name for the Server or Server Management and Platform Software.

Creating the Initial Account From the SM Console

To create the initial manager account from the SM Console:

1. Enter the SP name or IP address as the URL or address in a browser, to enter the SM Console.


2. At the Create Initial Manager-Level User ID screen, enter a user ID for this account.

3. Enter a password for the account.

4. Re-enter the password to confirm.

5. Click the check mark button.

6. Use the SM Console to select initial configuration options.

After you create the initial manager-level user, the Initial Configuration Checklist screen displays in the SM Console. This enables you to determine the options you want for the initial setup of the SP.

The Initial Configuration Checklist is a table that lists the SM Console menu options and the commands you use to configure each option. It also includes links to the online help that provides instructions for each option.




After you create the initial manager account, continue with Defining a Name for the Server or Server Management and Platform Software.

Defining a Name for the Server

If desired, you can define a name for the server that will be displayed in the operator-panel LCD when the SP is idle. After you define a name, the name and the IP address of the SP alternate every few seconds in the LCD.


1. When the server is in background state, press any operator-panel button (see FIGURE 2-1).

After you press a button, the LCD panel displays the first menu option:

Menu:

Server Menu

2. Press the Forward button until you reach the Panel menu:

Menu:

Panel menu

3. Press the Select button to display the Panel menu options.

4. Press the Forward button until the Name for LCD menu option displays:

Panel Menu:

Name for LCD?

5. Press the Select button to enable data entry.

6. Enter an alphanumeric string to display on the first line of the LCD.

You can enter letters A through Z, digits 0 through 9, hyphen and space.

a. Use the Forward and Back buttons to locate the character you wish to enter in each field.

b. Press the Select button when you locate the character you want.

c. Repeat this process until the entire name is complete.

7. Use the Enter button combination (Forward plus Select) to save your entry.

怎样在linux(RedHat)上实现802.1Q VLAN

最近刚做完这么一件事情
做的过程中从网上没找到非常详细、具体的文档
自己摸索着搞定
特写出来
哪位如果再有相同的需求的话
再做就非常容易了

我的环境非常简单
一台linux(RedHat as3)的机器(kernel 2.4.21)
公网eth0
私网eth1
以前私网是接的192.168.10网段的,vlan id为10
现在想把私网在保留原来10网段的同时,还想加一个192.168.240网段,vlan id为240

其实这个题目的答案非常简单
就是用vconfig嘛
vconfig add eth1 10
vconfig add eth1 240
然后再ifconfig eth1.10配ip
ifconfig eth1.240配ip地址
用vconfig大家应该都差不多能解决这个问题

当然啦
在交换机上得把这个端口配成trunk模式
既在vlan-id为10的网段
又在vlan-id为240的网段

我这里主要讲的是怎样“配置”
就是说不用写启动脚本
不用改原有的启动流程
就是说重起机器(或者是/etc/rc.d/init.d/network restart)之后
系统的网络设备就已经ok
既能直通192.168.10网段
又能直通192.168.240网段

我仔细看了启动流程的脚本文件
发现其实非常简单
1,编辑文件/etc/sysconfig/network
在里面添加一行:
VLAN=yes
再生成网卡设备的配置文件ifcfg-eth1.10和ifcfg-eth1.240
2,cd /etc/sysconfig/network-scripts
cp ifcfg-eth1 ifcfg-eth1.10
cp ifcfg-eth1 ifcfg-eth1.240
3,编辑文件ifcfg-eth1.10和ifcfg-eth1.240
在里面类似于写ifcfg-eth1的语法配上此服务器在192.168.10网段和192.168.240网段的ip地址、netmask、network等等
注意:这两个文件的DEVICE得分别改成eth1.10和eth1.240(这两个文件都是由ifcfg-eth1复制过来,故原来应该是eth1)
4,再编辑ifcfg-eth1
vi ifcfg-eth1
删掉IPPADDRESS、NETMASK、NETWORK这跟ip地址相关的几行

一切OK了
无论现在是/etc/rc.d/init.d/network restart
还是
reboot

你将得到的系统将既跟192.168.10网段直通、又跟192.168.240网段直通

在RedHat enterprise advance server 3上测试过
RedHat 9上也没问题