afunms

My Software,My Dream—Forge a more perfect NMS product.

#

opennms discovery模块中的两个问题.

DiscoveryLink.java

1.对ARP表发现时,以下代码有问题:

/**
                      * 在XX的网络中测试,以下这段代码不正确.确切地说应该是对华为设备不成立,对其他设备还是可以
                      * 的opennms的程序员在写程序时肯定是没有接触华为的设备.(2009.7.25)
                      
*/
 
                    
if (isMacIdentifierOfBridgeNode(macAddress)) {
                        
if (log().isInfoEnabled()) 
                        log().info(
"run: at interface " + macAddress
                                
+ " belongs to bridge node! Not adding to discoverable atinterface.");
                        macsExcluded.add(macAddress);
                        
continue;
                    }
2. 对Route表发现时,以下代码也有问题:
/**
                         * 这个if语句不适合,也许opennms的牛人只考虑FastEthernet接口
                         
*/

                        
if (snmpiftype == SNMP_IF_TYPE_ETHERNET) {
                            
if (log().isInfoEnabled())
                                log().info(
"run: Ethernet interface for nodeid. Skipping ");
                            
continue;
                        }

posted @ 2009-07-25 08:48 afunms 阅读(254) | 评论 (0)编辑 收藏

纪念波仔

与你同事一年多,你的敬业精神和技术水平都给大家留下很深的印象。

今天见你最后一眼,突然间,我哭了。
明天是父亲节,初为人父的你,还没来得及享受这个天伦之乐就匆匆离去.....

但愿你在另一个世界不再受病魔的折磨!
同时祝你的家人平安幸福。

posted @ 2009-06-20 23:10 afunms 阅读(132) | 评论 (0)编辑 收藏

一张专家推荐的最健康的作息时间表

   7:30:起床。英国威斯敏斯特大学的研究人员发现,那些在早上5:22—7:21分起床的人,其血液中有一种能引起心 脏病的物质含量较高,因此,在7:21之后起床对身体健康更加有益。打开台灯。“一醒来,就将灯打开,这样将会重新调整体内的生物钟,调整睡眠和醒来模式。”拉夫堡大学睡眠研究中心教授吉姆·霍恩说。喝一杯水。水是身体内成千上万化学反应得以进行的必需物质。早上喝一杯清水,可以补充晚上的缺水状态。
   7:30—8:00:在早饭之前刷牙。“在早饭之前刷牙可以防止牙齿的腐蚀,因为刷牙之后,可以在牙齿外面涂上一层含氟的保护层。要么,就等早饭之后半小时再刷牙。”英国牙齿协会健康和安全研究人员戈登·沃特金斯说。
   8:00—8:30:吃早饭。“早饭必须吃,因为它可以帮助你维持血糖水平的稳定,”伦敦大学国王学院营养师凯文·威尔伦说。早饭可以吃燕麦粥等,这类食物具有较低的血糖指数。
   8:30—9:00:避免运动。来自布鲁奈尔大学的研究人员发现,在早晨进行锻炼的运动员更容易感染疾病,因为免疫系统在这个时间的功能最弱。步行上班。马萨诸塞州大学医学院的研究人员发现,每天走路的人,比那些久坐不运动的人患感冒病的几率低25%。
   9:30:开始一天中最困难的工作。纽约睡眠中心的研究人员发现,大部分人在每天醒来的一两个小时内头脑最清醒 。
   10:30:让眼睛离开屏幕休息一下。如果你使用电脑工作,那么每工作一小时,就让眼睛休息3分钟。
   11:00:吃点水果。这是一种解决身体血糖下降的好方法。吃一个橙子或一些红色水果,这样做能同时补充体内的铁含量和维生素C含量。
   13:00:在面包上加一些豆类蔬菜。你需要一顿可口的午餐,并且能够缓慢地释放能量。“烘烤的豆类食品富含纤维素,番茄酱可以当作是蔬菜的一部分。”维伦博士说。
   14:30—15:30:午休一小会儿。雅典的一所大学研究发现,那些每天中午午休30分钟或更长时间,每周至少午休3次的人,因心脏病死亡的几率会下降37%。
   16:00:喝杯酸奶。这样做可以稳定血糖水平。在每天三餐之间喝些酸牛奶,有利于心脏健康。
   17:00—19:00:锻炼身体。根据体内的生物钟,这个时间是运动的最佳时间,舍菲尔德大学运动学医生瑞沃·尼克说。
   19:30:晚餐少吃点。晚饭吃太多,会引起血糖升高,并增加消化系统的负担,影响睡眠。晚饭应该多吃蔬菜,少吃富含卡路里和蛋白质的食物。吃饭时要细嚼慢咽。
   21:45:看会电视。这个时间看会儿电视放松一下,有助于睡眠,但要注意,尽量不要躺在床上看电视,这会影响睡眠质量。
   23:00:洗个热水澡。“体温的适当降低有助于放松和睡眠。”拉夫堡大学睡眠研究中心吉姆·霍恩教授说。
   23:30:上床睡觉。如果你早上7点30起床,现在入睡可以保证你享受8小时充足的睡眠。

posted @ 2009-06-14 11:47 afunms 阅读(137) | 评论 (0)编辑 收藏

SQL ' 转义字符

例:select * from tbl where uyear='''06'

请注意其中红色背景的单引号,它即表示转义字符,如果我们省略,则整个语句会出错,转义字符不会输出,上例中 uyear 的实际条件值为 '06,而不是 ''06

为什么不能省略呢,假如我们省略,上句变成:select * from tbl where uyear=''06'

由于在 SQL 中单引号表示字符串的开始和结束符号,于是 SQL 解释器会认为语句中灰色背景的为字符串,其后的语句显然是个错误的语句,当然会报错,为了解决字符串的单引号问题,就出现了转义字符单。


解决了我的一个大问题,不然程序就要大改了。

posted @ 2009-06-13 21:16 afunms 阅读(547) | 评论 (0)编辑 收藏

Oracle buys Sun for US$7.4 bln

Source: CCTV.com
04-21-2009 13:29
Oracle Corporation has snapped up computer server and software maker Sun Microsystems for 7.4 billion US dollars. It trumped rival IBM's attempt to buy one of Silicon Valley's best known, and most troubled, companies.

Monday's deal comes after a month-long drama that entered its final chapter last week. IBM had retracted an earlier buyout offer after the two sides couldn't agree on key details.

Oracle has traditionally been a business software maker. It will now be able to use Sun's assets to build a more comprehensive one-stop technology shop. The deal gives Oracle ownership of the Java programming language, which runs on more than a billion devices around the world.


        今天在电视上听到这消息,真是挺吃惊的。对于一个长期从事Java开发的程序员来说,对Sun有一种特殊的感情。现在Sun突然从地球上消失了。。。。,很难接受这样的事实。

 

posted @ 2009-04-21 21:53 afunms 阅读(180) | 评论 (1)编辑 收藏

workflow

http://en.wikipedia.org/wiki/Workflow

A workflow is a depiction of a sequence of operations, declared as work of a person, work of a simple or complex mechanism, work of a group of persons,work of an organization of staff, or machines. Workflow may be seen as any abstraction of real work, segregated in workshare, work split or whatever types of ordering. For control purposes, workflow may be a view on real work under a chosen aspect,thus serving as a virtual representation of actual work. The flow being described often refers to a document that is being transferred from one step to another.

A workflow is a model to represent real work for further assessment, e.g., for describing a reliably repeatable sequence of operations. More abstractly, a workflow is a pattern of activity enabled by a systematic organization of resources, defined roles and mass, energy and information flows, into a work process that can be documented and learned.Workflows are designed to achieve processing intents of some sort, such as physical transformation, service provision, or information processing.

Workflow concepts are closely related to other concepts used to describe organizational structure, such as silos, functions, teams, projects, policies and hierarchies. Workflows may be viewed as one primitive building block of organizations. The relationships among these concepts are described later in this entry.

The term workflow is used in computer programming to capture and develop human to machine interaction. Workflow software aims to provide end users with an easier way to orchestrate or describe complex processing of data in a visual form, much like flow charts but without the need to understand computers or programming.

posted @ 2009-03-07 10:23 afunms 阅读(160) | 评论 (0)编辑 收藏

OSWorkflow Tomcat5.5 JDBC配置

  (1)   创建MySQL数据库osworkflow
          新建osworkflow数据库,然后导入osworkflow\src\etc\deployment\jdbc\mysql.sql
  (2)   在Tomcat下创建配置文件
          tomcat5.5.23\conf\Catalina\localhost\osworkflow.xml
<?xml version='1.0' encoding='utf-8'?>
<Context path="/osworkflow" debug="0" reloadable="true">
 <Resource
 name="jdbc/DefaultDS"
 type="javax.sql.DataSource"
 driverClassName="com.mysql.jdbc.Driver"
 maxIdle="10"
 maxWait="5000"
 username="root"
 password="root"
 url="jdbc:mysql://localhost:3306/osworkflow?useUnicode=true&amp;characterEncoding=utf-8"
 maxActive="20"/>
</Context>
  (3)修改WEB-INF\classes\osuser.xml
<opensymphony-user>
    <provider class="com.opensymphony.user.provider.jdbc.JDBCAccessProvider">
    <property name="user.table">os_user</property>
    <property name="group.table">os_group</property>
    <property name="membership.table">os_membership</property>
    <property name="user.name">username</property>
    <property name="user.password">passwordhash</property>
    <property name="group.name">groupname</property>
    <property name="membership.userName">username</property>
    <property name="membership.groupName">groupname</property>
    <property name="datasource">jdbc/DefaultDS</property>
    </provider>
    <provider class="com.opensymphony.user.provider.jdbc.JDBCCredentialsProvider">
       <property name="user.table">os_user</property>
    <property name="group.table">os_group</property>
    <property name="membership.table">os_membership</property>
    <property name="user.name">username</property>
    <property name="user.password">passwordhash</property>
    <property name="group.name">groupname</property>
    <property name="membership.userName">username</property>
    <property name="membership.groupName">groupname</property>
    <property name="datasource">jdbc/DefaultDS</property>
    </provider>
    <provider class="com.opensymphony.user.provider.jdbc.JDBCProfileProvider">
       <property name="user.table">os_user</property>
    <property name="group.table">os_group</property>
    <property name="membership.table">os_membership</property>
    <property name="user.name">username</property>
    <property name="user.password">passwordhash</property>
    <property name="group.name">groupname</property>
    <property name="membership.userName">username</property>
    <property name="membership.groupName">groupname</property>
    <property name="datasource">jdbc/DefaultDS</property>
    </provider>
 <authenticator class="com.opensymphony.user.authenticator.SmartAuthenticator" />
</opensymphony-user>




posted @ 2009-02-22 21:24 afunms 阅读(509) | 评论 (0)编辑 收藏

研究工作流

       以前我对工作流根本没概念,但研究了OSWorkflow,特别是看了网上那个例子后,突然间豁然开朗。如果不是研究工作流,我从不认为系统中“组织架构”模块会如此复杂。公司的OA为什么不可扩展,就是因为“组织架构”设计得很不合理。

posted @ 2009-02-21 12:01 afunms 阅读(135) | 评论 (0)编辑 收藏

TestCase

A test case in software engineering is a set of conditions or variables under which a tester will determine whether an application or software system meets specifications. The mechanism for determining whether a software program or system has passed or failed such a test is known as a test oracle. In some settings an oracle could be a requirement or use case. It may take many test cases to determine that a software program or system is functioning correctly. Test cases are often referred to as test scripts, particularly when written. Written test cases are usually collected into test suites.

Formal, requirement-based test cases
In order to fully test that all the requirements of an application are met, there must be at least one test case for each requirement unless a requirement has sub-requirements. In that situation, each sub-requirement must have at least one test case. This is frequently done using a traceability matrix. Some methodologies, like RUP, recommend creating at least two test cases for each requirement. One of them should perform positive testing of requirement and other should perform negative testing. Written test cases should include a description of the functionality to be tested, and the preparation required to ensure that the test can be conducted.

What characterizes a formal, written test case is that there is a known input and an expected output, which is worked out before the test is executed. The known input should test a precondition and the expected output should test a postcondition.

posted @ 2009-02-19 22:07 afunms 阅读(196) | 评论 (0)编辑 收藏

Test my program

 

Tested configuration and discovery modules,this is the first time I test my program so carefully.Since SV2.0 has much bug,now I am aware of the importance of testing.

I tested the following cases:

Configuration

1. Add a network device to the network device list

2. Add a server to the server list

3. Remove a network device from the network device list

4. Remove a server from the server list

5. Add a network device to the server list(failure is correct)

6. Add a server to the network device list(failure is correct)

7. Add a link road

8. Remove a link road

9. Query a server/network device/link according to the given condition

Discovery

10. Totally new discover a network configuration

11. Re-discover a network configuration

12. Remove a network configuration

posted @ 2009-02-18 22:09 afunms 阅读(131) | 评论 (0)编辑 收藏

惠州之行

行程:
2月11日 下午 惠州ZFW  给客户培训SourceView基本操作
2月11日 下午 惠州GA     产品推广
2月12日 上午 惠州JCY   产品推广

bug:
1. IP资源没有数据;
2. 数据库某个表字段太短,字值插不进去;
3. 报表页面上有-1,没有处理;
4. 子网网关有NULL,干脆在页面上隐藏“网关”这列。

另,用户要求增加短信报警的功能。

总结:
1. 现在用户的技术水平也在提高,这对我们的专业水平、我们的产品质量都提出了更高的要求;
2. 市场潜力大,但不同的用户需求可能差别很大,这就要求我们的产品要有很强的扩展性。

posted @ 2009-02-12 12:02 afunms 阅读(111) | 评论 (0)编辑 收藏

NodeManager

     摘要:   今天终于把NodeManager的接口确定下来了。代码不知改了多少次,才成为今天这个样子, 每个接口都有明确的定义和责任,真是不容易。2.0中这块写得极混乱,代码重用性不好,可扩 展性受到很大影响。3.0中能把NodeManager的接口设计好,算是整个架构的一个重大改进。 NodeManager完成以下功能: 1.加入网元前,检查用户输入的参数,以及这个网元是否已经存在...  阅读全文

posted @ 2009-01-25 17:06 afunms 阅读(360) | 评论 (0)编辑 收藏

3.0discovery模块总结

 1.    解决了有时发现程序结束不了的问题,根本原因在于有一个set没有同步,改为

hasDetected = Collections.synchronizedSet(new HashSet<String>())

后,问题解决。

2.    更改了路由发现中关于子网的一个bug:

原代码:

        if(!pool.existSubnet(subnet)){

          engine.addSubnet(subnet);

            router.addSubnet(subnet);

      }

改为:

Subnet subnet = pool.getSubnetByIP(item.getDest());

          if(subnet==null){ //if subnet doesn't exist

               subnet = new Subnet();                  

              subnet.setNetAddress(item.getDest());

              subnet.setNetMask(item.getNetMask());

              engine.addSubnet(subnet);           

           }

         router.addSubnet(subnet);

3.    2.0中只能对一个网络进行发现,3.0可以对多个网络进行发现,画出多个拓扑图。

4.    2.0中只能有一个发现范围,3.0可以增加多个发现范围。

5.    2.0中各表之间没有关联,初始化时要执行多条SQL代码,3.0中利用表外键,
只要删除一条记录,就可以删除所有相关数据。

6.    3.0在发现完之后,保存所有设备的SNMP表数据。

7.    3.0为再发现留有接口,使拓扑再发现成为可能,只是暂时没时间去实现。

8.    拓扑节点排序算法以及拓扑图的生成

排序算法 MapCompositor 给它节点以及连接,按一定算法计算出各节点的位置坐标。
DefaultCompositor实现接口computeCoordinate,把节点按排成若干个圆。

用DefaultMapBuilder dmb = new DefaultMapBuilder();

dmb.buildMap(config.getId());

来测试排序算法,因为它不要用到内存中的数据,直接取数据库的数据。

   发现执行的是 NewDiscoveryVisitor.buildDefaultMap()

   调用发现后内存中的数据。

9.增加网络设备的服务器时,可以重用发现模块中的代码。在2.0中是专门写了一长串代码,
与发现模块没关系。

posted @ 2009-01-24 22:21 afunms 阅读(289) | 评论 (1)编辑 收藏

对添加网络设备的处理

        对于在发现之后,再添加一个网络设备的处理有点麻烦。我认为除了增加设备本身还应该找出它与即有设备之间的链路,这必然要重用发现模块的代码,会造成代码的混乱,但这不是关键。关键如果在这个过程中“发现”出了异常,程序无法返回,会给用户奇怪的感觉。

        目前的代码是按我的想法实现的,在公司的网络环境中测试中通过了。但不能保证在其他复杂的环境中得到一样的结果。

posted @ 2009-01-21 11:34 afunms 阅读(165) | 评论 (0)编辑 收藏

Modules of SourceView3.0

 

Modules of SourceView3.0:

1. Topology Discovery:System initializes,discovering all devices and the links among them.Devices includes routers,switches,route switches,ATM Switches and servers.

2. Configuration Management:Manages all of IT elements in NMS,including network devices,servers,DBs,midwares and web-servers.Add elements intoNMS,remove elements from it and so on.

3. Report Management:Defines some useful reports,users can review the performance data of any IT elements through these reports.

4. Business View:Users can define a view by themselves.The elements associate with the specified business system that they concern would be dragged into this view.

5. Topology View: Shows network topology and reflects real running status of the entire network.e.g.traffic of links.

6. Fault Management:Analyses the performance data collected by monitors,if it violates the rules defined by users,NMS would alarm immediately.

7. Performance Management:Collects performance data from IT elements by all Kinds of monitors.


posted @ 2009-01-20 21:49 afunms 阅读(212) | 评论 (0)编辑 收藏

仅列出标题
共25页: 上一页 1 2 3 4 5 6 7 8 9 下一页 Last 

My Links

News

留言簿(18)

随笔档案

相册

搜索

最新评论

阅读排行榜