ip-stories.com

  •  

    September 2010
    M T W T F S S
    « Aug    
     12345
    6789101112
    13141516171819
    20212223242526
    27282930  
  • Web Stat Counter

    • Search This Blog :

    • Add url
    • Add Me on FB

      Rahman Isnaini's Facebook profile
    • Hurricane Electric IPv6 Cert

      IPv6 Certification Badge for risnaini
    • comments

    • Visitors Referred From :

    • Geo Stats

    • Categories

    Archive for the 'Script' Category


    [MRTG] How To Monitor Number of BGP Prefixes from BGP Peer on Cisco Router(s) using MRTG

    Posted by admin on 29th July 2010

    This is my CFG File.

    The complete OID is 1.3.6.1.4.1.9.9.187.1.2.4.1.1.192.168.150.164.1.1
    The OID of Accepted BGP Routes : 1.3.6.1.4.1.9.9.187.1.2.4.1.1
    The OID of Max BGP Routes : 1.3.6.1.4.1.9.9.187.1.2.4.1.3
    [well this not really important as this just to make the mrtg capturing to work, since mrtg MRTG needs to graph two variables/OIDs].
    The IP Address of the BGP Peer being monitored : 192.168.150.164
    The version of IP & Routing Type : 1.1 > IPv4 & Unicast.

    mrtg# vi /export/cfg/bgp-prefix.cfg

    WorkDir: /var/data-mrtg/bgp
    LogFormat: rrdtool
    PathAdd: /usr/local/bin/
    LibAdd: /usr/local/lib/perl5/5.8.8
    Interval: 5
    Refresh: 300
    Forks: 4

    Options[_]: gauge, nopercent, integer
    Unscaled[_]: ymwd
    YLegend[_]: Number of Prefix
    ShortLegend[_]:
    LegendI[_]:   Received Prefixes
    LegendO[_]:   Withdrawn Prefixes
    Legend1[_]: Number of Accepted Prefixes
    Legend2[_]: Withdrawn

    ### as999
    Target[bgp-as999]: 1.3.6.1.4.1.9.9.187.1.2.4.1.1.192.168.150.164.1.1&1.3.6.1.4.1.9.9.187.1.2.4.1.3.192.168.150.164.1.1:public@192.168.150.129
    MaxBytes[bgp-as999]: 1250
    Title[bgp-as999]: BGP Prefixes AS999
    PageTop[bgp-as999]:

    BGP Prefixes AS999

    System: Cisco Gateway
    Equipment: Cisco 3750
    Maintainer: NOC Jakarta

    =================== Options Information ======================
    More information on : MRTG Website

    gauge

    Treat the values gathered from target as ‘current status’ measurements
    and not as ever incrementing counters.
    This would be useful to monitor things like disk space, BGP Prefixes,
    processor load, temperature, and the like …

    integer

    Print summary lines below graph as integers without commas, if you missed this on your option… MRTG would print / plot the value with additional x.000 for example 50 prefixes > 50.000 prefixes.
    nopercent

    Don’t print usage percentages.

    ==================== Router IOS Version =======================

    3750-GW#sh ver
    Cisco IOS Software, 3700 Software (C3725-ADVIPSERVICESK9-M), Version 12.4(3), RELEASE SOFTWARE (fc2)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 1986-2005 by Cisco Systems, Inc.
    Compiled Fri 22-Jul-05 02:27 by hqluong

    ROM: System Bootstrap, Version 12.2(8r)T2, RELEASE SOFTWARE (fc1)

    3750-GW uptime is 20 weeks, 19 hours, 34 minutes
    System returned to ROM by power-on
    System restarted at 11:04:16 UTC Wed Mar 10 2010
    System image file is “flash:c3725-advipservicesk9-mz.124-3.bin”

    It’s 12.4-3 Version….

    a. rahman isnaini r.sutan

    Posted in Cisco, MRTG, Script | No Comments »

    [Mobile] Sending SMS from PC with Sony Ericsson W200 - Error

    Posted by admin on 29th July 2010

    Sending / Receibing SMS on PC may be is a good choice if you have a frequent sms activity.
    Working with Sony Ericsson W200 and refer to Website & Best Simple Guide : ” Developers Home
    Here What I have done :

    1. Install Sony Ericsson W200 Driver
    2. Inspecting which COM Port it’s connected.
    3. Use that port to communicate.
    4. Use Hyper Terminal to check : [Communication between PC & SE W200 is fine].

    AT
    OK
    AT+CMGF=1
    OK
    AT+CMGW=”+628176388704″
    > A simple demo of SMS text messaging.
    +CMGW: 1

    OK
    AT+CMSS=1
    +CMSS: 20

    OK

    Here is a description of what is done in the above example:

    *      Line 1: “AT” is sent to the GSM / GPRS modem to test the connection. The GSM / GPRS modem sends back the result code “OK” (line 2), which means the connection between the HyperTerminal program and the GSM / GPRS modem works fine.
    *      Line 3: The AT command +CMGF is used to instruct the GSM / GPRS modem to operate in SMS text mode. The result code “OK” is returned (line 4), which indicates the command line “AT+CMGF=1″ has been executed successfully. If the result code “ERROR” is returned, it is likely that the GSM / GPRS modem does not support the SMS text mode. To confirm, type “AT+CMGF=?” in the HyperTerminal program. If the response is “+CMGF: (0,1)” (0=PDU mode and 1=text mode), then SMS text mode is supported. If the response is “+CMGF: (0)”, then SMS text mode is not supported.

    My SE W200 Respond : [Not Support SMS Text Mode]
    =========================================
    OK

    +CPIN: READY

    OK

    +CMS ERROR: 303

    OK

    +CMS ERROR: 303

    +CMS ERROR: 303

    +CMGF: (0)

    OK
    ===================

    *      Line 5 and 6: The AT command +CMGW is used to write an SMS text message to the message storage of the GSM / GPRS modem. “+85291234567″ is the recipient mobile phone number. After typing the recipient mobile phone number, you should press the Enter button of the keyboard. The GSM / GPRS modem will then return a prompt “> ” and you can start typing the SMS text message “A simple demo of SMS text messaging.”. When finished, press Ctrl+z of the keyboard.
    *      Line 7: “+CMGW: 1″ tells us that the index assigned to the SMS text message is 1. It indicates the location of the SMS text message in the message storage.
    *      Line 9: The result code “OK” indicates the execution of the AT command +CMGW is successful.
    *      Line 10: The AT command +CMSS is used to send the SMS text message from the message storage of the GSM / GPRS modem. “1″ is the index of the SMS text message obtained from line 7.
    *      Line 11: “+CMSS: 20″ tells us that the reference number assigned to the SMS text message is 20.
    *      Line 13: The result code “OK” indicates the execution of the AT command +CMSS is successful.

    a. rahman isnaini r.sutan

    Posted in Mobile, Script | No Comments »

    [SNMP/MRTG] How to Graph Summary of Multiple MIBs over than 650 Mbps

    Posted by admin on 27th July 2010

    ============== Captured from Cisco Web FAQ ==============

    Q. When should 64-bit counters be used?

    A. RFC 2233 leavingcisco.com adopted expanded 64-bit counters for high capacity interfaces in which 32-bit counters do not provide enough capacity and wrap too fast.

    As the speed of network media increases, the minimum time in which a 32-bit counter wraps decreases. For example, a 10 Mbps stream of back-to-back, full-size packets causes ifInOctets to wrap in just over 57 minutes. At 100 Mbps, the minimum wrap time is 5.7 minutes, and at 1 Gbps, the minimum is 34 seconds.

    Note: The SNMP counters wrap, the command line interface (CLI) counters do not.

    For interfaces that operate at 20,000,000 (20 million) bits per second or less, you must use 32-bit byte and packet counters. For interfaces that operate faster than 20 million bits per second, and slower than 650,000,000 bits per second, you must use 32-bit packet counters and 64-bit octet counters. For interfaces that operate at 650,000,000 bits/second or faster, 64-bit packet and octet counters must be used.

    Correspondingly, Cisco IOS® Software does not support 64-bit counters for interface speeds of less than 20 Mbps. This means that 64-bit counters are not supported on 10 Mb Ethernet ports, only 100 Mb Fast-Ethernet and other high speed ports support 64-bit counters.
    ===================================================================================

    Lately I have a problem with Adding multiple MIB traffic from many devices with many interfaces.
    The purpose is to summarize all of interface traffic volume.
    The problem I have faced was : if the total / summary of all traffic volume more than 650 Mbps [650,000,000 bit/seconds], the graph starts to drop / broken / not smooth.

    So We never saw the real of total traffic in that graph.
    By Default my mrtg engine use snmp v1 to capture dan plot MIB into the graph.
    According to above Cisco Website, I need to change the 32 bit counter to 64 bit counter to graph the traffic above 650 Mbit per second.
    Googling around, We have to add the suffix at the end of MIB in MRTG CFG file with “:::::2″ which means that my engine is now capturing 64 bit counter information [MIB] with version 2.

    There you go :)

    Read the rest of this entry »

    Posted in MRTG, Script | No Comments »

    [Juniper] Activate / Deactivated Command

    Posted by admin on 14th December 2009

    Activate / Deactivate Command is more like disabling / enabling configuration in JunOS.
    The purpose is just to keep the setting / configuration by disabling / deactivating it.
    Once you need to activate just one step to do :)

    Drawback is keeping more config file size.
    For small config changes is fine to have.

    Here the steps example deactivating a term in a policy option - policy statement named “IMPORT-PCCW”

    Steps :
    ===================================================
    admin@junOS# deactivate term prefered-outgoing

    [edit policy-options policy-statement IMPORT-PCCW]
    admin@junOS# show
    inactive: term prefered-outgoing {
    from as-path PACNET;
    then {
    local-preference 6200;
    accept;
    }
    }
    term else {
    from as-path ALL ;
    then reject;
    }

    [edit policy-options policy-statement IMPORT-PCCW]

    admin@junOS# commit
    commit complete

    [edit policy-options policy-statement IMPORT-PCCW]
    ====================================================

    The Effect :

    a. Before :

    admin@junOS# run show bgp summary
    Groups: 11 Peers: 13 Down peers: 4
    Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
    inet.0            926409     313202          0          0          0          3
    Peer               AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Damped…
    xxx.yyy.ddd.aaa     ABCD     349732    19848       0       0  6d 21:04:56    40/300121/0          0/0/0

    b. After :

    admin@junOS# run show bgp summary
    Groups: 11 Peers: 13 Down peers: 4
    Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
    inet.0            926409     313202          0          0          0          3
    Peer               AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Damped…
    xxx.yyy.ddd.aaa   ABCD     349732    19848       0       0  6d 21:04:56    0/300123/0          0/0/0

    Daily Juniper Simple Notes
    – a. rahman isnaini r.sutan

    Posted in BGP, Juniper, Script | No Comments »

    [MRTG] Error: AbsMax Smaller Than MaxBytes & Intermittent RRD Graph

    Posted by admin on 19th August 2009

    MRTG RRD Intermittent Graph may caused by higher Bytes graph to be captured / plotted compared to Max Bytes set in your cfg.
    Let say your real utilization is more than 200 Mbps.
    Your Max Bytes set to : 25000000 > 200 Mbps

    If your MRTG RRD needs to graph the traffic over 200 Mbps, it can’t.
    Therefor you’ll never see the graph under 200 Mbps in which the value you’ll see : 0 byte
    Anyway, your MRTG wouldn’t tell you any of error such below :

    mrtg# /usr/local/bin/mrtg /export/cfg/total.cfg
    ERROR: AbsMax: 25000000 is smaller than MaxBytes: 50000000

    Untill you have changed your MaxBytes higher than AbsMax default values.
    And [AFAIK] AbsMax by default is also : 25000000
    So the solution is set your cfg file this way :

    AbsMax[total]: 50000000 [just add AbsMax]
    MaxBytes[total]: 50000000

    Have fun with continues graph and higher graph plotted compared to previous one :)

    a. rahman isnaini r.sutan
    Thanks IPP

    Posted in MRTG, Script | No Comments »

    [Unix/Linux] Replace some characters/strings to another wanted characters/strings in Unix/Linux Log File.

    Posted by admin on 6th August 2009

    It very easy if we have worked with Microsoft Excel / Notepad / Wordpad ect..
    Linux/Unix Console ?
    Lately, we found IP Address Reverse in a raw log of TCP Dump never been parsed by PHP/Perl script in to a Database
    Need to replace those strings to the real IP.
    Here the Command :

    #cat TD-CPWAN-20090625.log | sed -es’/static-168-230-217.isp.net.id/192.168.230.217/’ > TD-CPWAN-20090625-PTR-217.log
    #mv TD-CPWAN-20090625-PTR-217.log TD-CPWAN-20090625.log

    Now you should see “static-168-230-217.isp.net.id” replaced with “192.168.230.217″ in your raw log.

    a. rahman isnaini r.sutan
    Thanks to Geri Anggara for the Script

    Posted in Linux, Script | No Comments »

    [Script] Drop Down Menu with Clock & Date

    Posted by admin on 19th May 2009

    <html>
    <head>
    <script type=”text/javascript” language=”JavaScript”>
    <!– Copyright 2002 Bontrager Connection, LLC

    function getCalendarDate()
    {
    var months = new Array(13);
    months[0]  = “January”;
    months[1]  = “February”;
    months[2]  = “March”;
    months[3]  = “April”;
    months[4]  = “May”;
    months[5]  = “June”;
    months[6]  = “July”;
    months[7]  = “August”;
    months[8]  = “September”;
    months[9]  = “October”;
    months[10] = “November”;
    months[11] = “December”;
    var now         = new Date();
    var monthnumber = now.getMonth();
    var monthname   = months[monthnumber];
    var monthday    = now.getDate();
    var year        = now.getYear();
    if(year < 2000) { year = year + 1900; }
    var dateString = monthname +
    ‘ ‘ +
    monthday +
    ‘, ‘ +
    year;
    return dateString;
    } // function getCalendarDate()

    function getClockTime()
    {
    var now    = new Date();
    var hour   = now.getHours();
    var minute = now.getMinutes();
    var second = now.getSeconds();
    var ap = “AM”;
    if (hour   > 11) { ap = “PM”;             }
    if (hour   > 12) { hour = hour - 12;      }
    if (hour   == 0) { hour = 12;             }
    if (hour   < 10) { hour   = “0″ + hour;   }
    if (minute < 10) { minute = “0″ + minute; }
    if (second < 10) { second = “0″ + second; }
    var timeString = hour +
    ‘:’ +
    minute +
    ‘:’ +
    second +
    ” ” +
    ap;
    return timeString;
    } // function getClockTime()

    //–>
    </script>

    <title>Corporate Portal</title>
    <style type=”text/css”>

    #tablist{
    padding: 2px 0;
    margin-left: 0;
    margin-bottom: 0;
    margin-top: 0;
    font: bold 12px Verdana;
    }

    #tablist li{
    list-style: none;
    display: inline;
    margin: 0;
    }

    #tablist li a{
    text-decoration: none;
    padding: 2px 0.4em;
    margin-left: 0px;
    border: none;
    border-bottom: none;
    border-top:none;
    background:;
    }

    #tablist li a:link, #tablist li a:visited{
    color: white;
    }

    #tablist li a:hover{
    color: #FF0000;
    background: ;
    border-color: #227;
    }

    #tablist li a.current{
    color:#navy;
    background: #;
    }

    </style>
    <script type=”text/javascript”>

    var selectedtablink=”"
    var tcischecked=false

    function handlelink(aobject){
    selectedtablink=aobject.href
    tcischecked=(document.tabcontrol && document.tabcontrol.tabcheck.checked)? true : false
    if (document.getElementById && !tcischecked){
    var tabobj=document.getElementById(”tablist”)
    var tabobjlinks=tabobj.getElementsByTagName(”A”)
    for (i=0; i<tabobjlinks.length; i++)
    tabobjlinks[i].className=”"
    aobject.className=”current”
    document.getElementById(”tabiframe”).src=selectedtablink
    return false
    }
    else
    return true
    }

    function handleview(){
    tcischecked=document.tabcontrol.tabcheck.checked
    if (document.getElementById && tcischecked){
    if (selectedtablink!=”")
    window.location=selectedtablink
    }
    }

    </script>
    <style type=”text/css”>
    /********************************************/
    #dropmenudiv{
    position:absolute;
    border:1px solid grey;
    border-bottom-width: 0;
    font:normal 12px Verdana;
    line-height:18px;
    z-index:100;
    }

    #dropmenudiv a{
    width: 100%;
    display: block;
    text-indent: 2px;
    border-bottom: 1px solid grey;
    padding: 1px 0;
    text-decoration: none;
    font-weight: bold;
    }

    #dropmenudiv a:hover{ /*hover background color*/
    background-color: ;
    }

    body {
    background-image: url();
    margin-left: 0%;
    margin-top: 0%;
    margin-right: 0%;
    margin-bottom: 0%;
    }
    .style8 {color: #black}
    </style>
    <script type=”text/javascript”>

    /***********************************************

    ***********************************************/

    var menu3=new Array()
    menu3[0]=’<a href=”http://www.speedtest.net/”>Speed Test</a>’
    menu3[1]=’<a href=”../portscan/index.php”>Port Vulnerability Check</a>’

    var menu4=new Array()
    menu4[0]=’<a href=”http://www.indo.net.id” onClick=”return handlelink(this)” target=”_blank”>Guwe. Inc</a>’
    menu4[1]=’<a href=”http://www.ipv6tf.org” onClick=”return handlelink(this)” target=”_blank”>IPv6</a>’

    var menuwidth=’165px’ //default menu width
    var menubgcolor=’white’  //menu bgcolor
    var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
    var hidemenu_onclick=”yes” //hide menu when user clicks within menu?

    var ie4=document.all
    var ns6=document.getElementById&&!document.all

    if (ie4||ns6)
    document.write(’<div id=”dropmenudiv” style=”visibility:hidden;width:’+menuwidth+’;background-color:’+menubgcolor+’” onMouseover=”clearhidemenu()” onMouseout=”dynamichide(event)”></div>’)

    function getposOffset(what, offsettype){
    var totaloffset=(offsettype==”left”)? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null){
    totaloffset=(offsettype==”left”)? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
    }
    return totaloffset;
    }

    function showhide(obj, e, visible, hidden, menuwidth){
    if (ie4||ns6)
    dropmenuobj.style.left=dropmenuobj.style.top=”-500px”
    if (menuwidth!=”"){
    dropmenuobj.widthobj=dropmenuobj.style
    dropmenuobj.widthobj.width=menuwidth
    }
    if (e.type==”click” && obj.visibility==hidden || e.type==”mouseover”)
    obj.visibility=visible
    else if (e.type==”click”)
    obj.visibility=hidden
    }

    function iecompattest(){
    return (document.compatMode && document.compatMode!=”BackCompat”)? document.documentElement : document.body
    }

    function clearbrowseredge(obj, whichedge){
    var edgeoffset=0
    if (whichedge==”rightedge”){
    var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
    dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
    if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
    edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
    }
    else{
    var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
    var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
    dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
    if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
    edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
    if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
    edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
    }
    }
    return edgeoffset
    }

    function populatemenu(what){
    if (ie4||ns6)
    dropmenuobj.innerHTML=what.join(”")
    }

    function dropdownmenu(obj, e, menucontents, menuwidth){
    if (window.event) event.cancelBubble=true
    else if (e.stopPropagation) e.stopPropagation()
    clearhidemenu()
    dropmenuobj=document.getElementById? document.getElementById(”dropmenudiv”) : dropmenudiv
    populatemenu(menucontents)

    if (ie4||ns6){
    showhide(dropmenuobj.style, e, “visible”, “hidden”, menuwidth)
    dropmenuobj.x=getposOffset(obj, “left”)
    dropmenuobj.y=getposOffset(obj, “top”)
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, “rightedge”)+”px”
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, “bottomedge”)+obj.offsetHeight+”px”
    }

    return clickreturnvalue()
    }

    function clickreturnvalue(){
    if (ie4||ns6) return false
    else return true
    }

    function contains_ns6(a, b) {
    while (b.parentNode)
    if ((b = b.parentNode) == a)
    return true;
    return false;
    }

    function dynamichide(e){
    if (ie4&&!dropmenuobj.contains(e.toElement))
    delayhidemenu()
    else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
    delayhidemenu()
    }

    function hidemenu(e){
    if (typeof dropmenuobj!=”undefined”){
    if (ie4||ns6)
    dropmenuobj.style.visibility=”hidden”
    }
    }

    function delayhidemenu(){
    if (ie4||ns6)
    delayhide=setTimeout(”hidemenu()”,disappeardelay)
    }

    function clearhidemenu(){
    if (typeof delayhide!=”undefined”)
    clearTimeout(delayhide)
    }

    if (hidemenu_onclick==”yes”)
    document.onclick=hidemenu
    </script>
    <meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>

    <script language=”JavaScript” type=”text/JavaScript”>
    <!–
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
    if (init==true) with (navigator) {if ((appName==”Netscape”)&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    //–>
    </script>
    </head>
    <base target=”center”>
    <span class=”style8″></span><span class=”style8″></span>
    <table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”67%” height=”50%”>
    <tr><td height=”80″ colspan=”2″ valign=”bottom”>
    <img src=”onegate.JPG” width=”849″ height=”75″ align=”top”></td></tr>
    <tr bgcolor=”#000000″><td height=”20″ colspan=”2″ valign=”bottom” nowrap bgcolor=”#808080″>
    <center><ul id=”tablist”>
    <li><a href=”cp.htm”>Bandwidth Utility</a><font color=”#FF0000″> |</font> </li>
    <li><a href=”http://192.168.32.101/test/client_report1.php?client=USER”>User
    Behavior</a>&nbsp; <font color=”#FF0000″>|</font></li>

    <li>
    <a href=”" onMouseover=”dropdownmenu(this, event, menu3, ‘170px’)” onMouseout=”delayhidemenu()”>
    Network Tools&nbsp; </a><font color=”#FF0000″>|</font></li>
    <li><a href=”http://account.guwe.com”>Billing Information</a><font color=”#FF0000″>|
    </font>
    <a href=”" onMouseover=”dropdownmenu(this, event, menu4, ‘170px’)” onMouseout=”delayhidemenu()”>About</a></li>

    </ul></center></td>
    </tr>
    <tr><td height=”2″ colspan=”2″ align=”right” valign=”top”>
    </td></tr>
    <tr>

    <td width=”50%” height=”50%” align=”left” valign=”top”><font face=”Trebuchet MS” size=”2″>Welcome, <b>User</b></font></td>
    <td width=”50%” align=”right” valign=”top”>
    <script type=”text/javascript” language=”JavaScript”><!–
    var calendarDate = getCalendarDate();
    var clockTime = getClockTime();
    document.write(’<font size=”1″ face=”Trebuchet MS”><B>’ + calendarDate);
    document.write(’<br>’);
    document.write(’</B>’ + clockTime);
    //–></script>

    <br>
    Online 24 hours support<br>
    (021)5210607<br>

    <a href=”ymsgr:sendIM?support3″><font color=”#FFFFFF” face=”Arial”><IMG src=”http://opi.yahoo.com/online?u=indonetnmc&m=g&t=1″ alt=”Ym” border=0></font></a></td>
    </tr>
    </table>

    </html>

    Posted in Java, Script | No Comments »

    [MRTG] How to Negate / Invert Incoming Traffic Graph to be Outgoing or vice versa using OIDs

    Posted by admin on 6th May 2009

    Negating a Normal MRTG Graph which created using MIB in a cfg file is pretty much easier.
    You have to put a “-” minus on the front of Target.

    “Target[customer-a]: -7:YOURNET@10.165.251.75:”

    Somehow you don’t have this MIB to create a graph of customer usage.
    For example, Mikrotik Traffic Shapping can be graphed using MRTG by OIDs.
    Mikrotik has two OIDs for incoming and outgoing traffic separately. Not just like one MIB can graph all In/Out integrated.
    Printing the OID you have :

    3    bytes-in=.1.3.6.1.4.1.14988.1.1.2.1.1.2.7
    bytes-out=.1.3.6.1.4.1.14988.1.1.2.1.1.8.7

    Normally, using above OIDs the graph realy shows exactly in traffic & out traffic.
    The order is :

    Target[customer-a]: 1.3.6.1.4.1.14988.1.1.2.1.1.2.7&1.3.6.1.4.1.14988.1.1.2.1.1.8.7:YOURNET@10.165.251.75:

    How to invert the graph, I tried to use negation “-” string on the front of the target.
    Some of errors appeared on mrtg console which says it’s not possible to do OIDs negation.
    So how to solve this is, change the target order where bytes-out on the first entry
    Just like this :

    Target[customer-a]: 1.3.6.1.4.1.14988.1.1.2.1.1.8.7&1.3.6.1.4.1.14988.1.1.2.1.1.2.7:YOURNET@10.165.251.75:

    You will now have an Inverted Graph [Out be In & In be Out]

    a. rahman isnaini r.sutan
    * Thanks to Indrajaya PP. & Ebenz Tufiq”

    Posted in MRTG, Script | No Comments »

    [JavaScript] My Analogue Clock

    Posted by a. Rahman Isnaini r. Sutan on 20th November 2008

    <script language=”JavaScript”>
    /* Javascript for timer */

    fCol=’FFFFFF’; //face colour.
    sCol=’FFFF00′; //seconds colour.
    mCol=’FF0000′; //minutes colour.
    hCol=’FF0000′; //hours colour.

    Ybase=30; //Clock height.
    Xbase=30; //Clock width.

    H=’….’;
    H=H.split(”);
    M=’…..’;
    M=M.split(”);
    S=’……’;
    S=S.split(”);
    NS4=(document.layers);
    NS6=(document.getElementById&&!document.all);
    IE4=(document.all);
    Ypos=0;
    Xpos=0;
    dots=12;
    Split=360/dots;
    if (NS6){
    for (i=1; i < dots+1; i++){
    document.write(’<div id=”n6Digits’+i+’” style=”position:absolute;top:0px;left:0px;width:30px;height:30px;font-family:Arial;font-size:10px;color:#’+fCol+’;text-align:center;padding-top:10px”>’+i+’</div>’);
    }
    for (i=0; i < M.length; i++){
    document.write(’<div id=”Ny’+i+’” style=”position:absolute;top:0px;left:0px;width:2px;height:2px;font-size:2px;background:#’+mCol+’”></div>’);
    }
    for (i=0; i < H.length; i++){
    document.write(’<div id=”Nz’+i+’” style=”position:absolute;top:0px;left:0px;width:2px;height:2px;font-size:2px;background:#’+hCol+’”></div>’);
    }
    for (i=0; i < S.length; i++){
    document.write(’<div id=”Nx’+i+’” style=”position:absolute;top:0px;left:0px;width:4px;height:4px;font-size:4px;background:#’+sCol+’”></div>’);
    }
    }
    if (NS4){
    dgts=’1 2 3 4 5 6 7 8 9 10 11 12′;
    dgts=dgts.split(’ ‘)
    for (i=0; i < dots; i++){
    document.write(’<layer name=nsDigits’+i+’ top=0 left=0 height=30 width=30><center><font face=Arial size=1 color=’+fCol+’>’+dgts[i]+’</font></center></layer>’);
    }
    for (i=0; i < M.length; i++){
    document.write(’<layer name=ny’+i+’ top=0 left=0 bgcolor=’+mCol+’ clip=”0,0,2,2″></layer>’);
    }
    for (i=0; i < H.length; i++){
    document.write(’<layer name=nz’+i+’ top=0 left=0 bgcolor=’+hCol+’ clip=”0,0,2,2″></layer>’);
    }
    for (i=0; i < S.length; i++){
    document.write(’<layer name=nx’+i+’ top=0 left=0 bgcolor=’+sCol+’ clip=”0,0,2,2″></layer>’);
    }
    }
    if (IE4){
    document.write(’<div style=”position:absolute;top:0px;left:0px”><div style=”position:relative”>’);
    for (i=1; i < dots+1; i++){
    document.write(’<div id=”ieDigits” style=”position:absolute;top:0px;left:0px;width:30px;height:30px;font-family:Arial;font-size:10px;color:’+fCol+’;text-align:center;padding-top:10px”>’+i+’</div>’);
    }
    document.write(’</div></div>’)
    document.write(’<div style=”position:absolute;top:0px;left:0px”><div style=”position:relative”>’);
    for (i=0; i < M.length; i++){
    document.write(’<div id=y style=”position:absolute;width:2px;height:2px;font-size:2px;background:’+mCol+’”></div>’);
    }
    document.write(’</div></div>’)
    document.write(’<div style=”position:absolute;top:0px;left:0px”><div style=”position:relative”>’);
    for (i=0; i < H.length; i++){
    document.write(’<div id=z style=”position:absolute;width:2px;height:2px;font-size:2px;background:’+hCol+’”></div>’);
    }
    document.write(’</div></div>’)
    document.write(’<div style=”position:absolute;top:0px;left:0px”><div style=”position:relative”>’);
    for (i=0; i < S.length; i++){
    document.write(’<div id=x style=”position:absolute;width:2px;height:2px;font-size:2px;background:’+sCol+’”></div>’);
    }
    document.write(’</div></div>’)
    }

    function clock(){
    time = new Date ();
    secs = time.getSeconds();
    sec = -1.57 + Math.PI * secs/30;
    mins = time.getMinutes();
    min = -1.57 + Math.PI * mins/30;
    hr = time.getHours();
    hrs = -1.57 + Math.PI * hr/6 + Math.PI*parseInt(time.getMinutes())/360;

    if (NS6){
    //Ypos=window.pageYOffset+window.innerHeight-Ybase-25;
    //Xpos=window.pageXOffset+window.innerWidth-Xbase-30;

    Ypos=window.pageYOffset+55;
    Xpos=window.pageXOffset+window.innerWidth-Xbase-30;

    for (i=1; i < dots+1; i++){
    document.getElementById(”n6Digits”+i).style.top=Ypos-15+Ybase*Math.sin(-1.56 +i *Split*Math.PI/180)
    document.getElementById(”n6Digits”+i).style.left=Xpos-15+Xbase*Math.cos(-1.56 +i*Split*Math.PI/180)
    }
    for (i=0; i < S.length; i++){
    document.getElementById(”Nx”+i).style.top=Ypos+i*Ybase/4.1*Math.sin(sec);
    document.getElementById(”Nx”+i).style.left=Xpos+i*Xbase/4.1*Math.cos(sec);
    }
    for (i=0; i < M.length; i++){
    document.getElementById(”Ny”+i).style.top=Ypos+i*Ybase/4.1*Math.sin(min);
    document.getElementById(”Ny”+i).style.left=Xpos+i*Xbase/4.1*Math.cos(min);
    }
    for (i=0; i < H.length; i++){
    document.getElementById(”Nz”+i).style.top=Ypos+i*Ybase/4.1*Math.sin(hrs);
    document.getElementById(”Nz”+i).style.left=Xpos+i*Xbase/4.1*Math.cos(hrs);
    }
    }
    if (NS4){
    Ypos=window.pageYOffset+55;
    Xpos=window.pageXOffset+window.innerWidth-Xbase-30;
    for (i=0; i < dots; ++i){
    document.layers["nsDigits"+i].top=Ypos-5+Ybase*Math.sin(-1.045 +i*Split*Math.PI/180)
    document.layers["nsDigits"+i].left=Xpos-15+Xbase*Math.cos(-1.045 +i*Split*Math.PI/180)
    }
    for (i=0; i < S.length; i++){
    document.layers["nx"+i].top=Ypos+i*Ybase/4.1*Math.sin(sec);
    document.layers["nx"+i].left=Xpos+i*Xbase/4.1*Math.cos(sec);
    }
    for (i=0; i < M.length; i++){
    document.layers["ny"+i].top=Ypos+i*Ybase/4.1*Math.sin(min);
    document.layers["ny"+i].left=Xpos+i*Xbase/4.1*Math.cos(min);
    }
    for (i=0; i < H.length; i++){
    document.layers["nz"+i].top=Ypos+i*Ybase/4.1*Math.sin(hrs);
    document.layers["nz"+i].left=Xpos+i*Xbase/4.1*Math.cos(hrs);
    }
    }

    if (IE4){
    Ypos=document.body.scrollTop+40;
    Xpos=document.body.scrollLeft+window.document.body.clientWidth-Xbase-20;
    for (i=0; i < dots; ++i){
    ieDigits[i].style.pixelTop=Ypos-15+Ybase*Math.sin(-1.045 +i *Split*Math.PI/180)
    ieDigits[i].style.pixelLeft=Xpos-15+Xbase*Math.cos(-1.045 +i *Split*Math.PI/180)
    }
    for (i=0; i < S.length; i++){
    x[i].style.pixelTop =Ypos+i*Ybase/4.1*Math.sin(sec);
    x[i].style.pixelLeft=Xpos+i*Xbase/4.1*Math.cos(sec);
    }
    for (i=0; i < M.length; i++){
    y[i].style.pixelTop =Ypos+i*Ybase/4.1*Math.sin(min);
    y[i].style.pixelLeft=Xpos+i*Xbase/4.1*Math.cos(min);
    }
    for (i=0; i < H.length; i++){
    z[i].style.pixelTop =Ypos+i*Ybase/4.1*Math.sin(hrs);
    z[i].style.pixelLeft=Xpos+i*Xbase/4.1*Math.cos(hrs);
    }
    }
    setTimeout(’clock()’,100);
    }
    clock();
    //–>
    </script>

    Posted in Script | No Comments »

    [MRTG] Error Uknown Option & Subid Too Big in Object ID

    Posted by a. Rahman Isnaini r. Sutan on 23rd October 2008

    ERROR 1:

    CFG Error Unknown Option “988.1.1.2.1.1.8.777&1.3.6.1.4.1.14988.1.1.2.1.1.9.777″ on line 21 or above.
    Check doc/reference.txt for Help

    Solution : for a long raw, make sure to have everything continuous perfectly written, copy & paste from a notepad sometimes unix doesn’t understand. Try to edit the configuration file with proper editor and while pasting to unix console, they are not separated.

    ERROR 2 :

    cannot encode Object ID .3.6.1.4.1.14988.1.1.2.1.1.8.778: first subid too big in Object ID 3.6.1.4.1.14988.1.1.2.1.1.8.778 at /usr/local/bin/mrtg line 1980

    Solution : check this line : 251.6 +.3.6.1.4.1.14988.1.1.2.1.1.8.778& > after “+” there should be 1.3.6.1.4… fix it (you have missed 1 character).
    ERROR 3:

    USE OF UNINITIALIZED VALUE in DIVISION
    [Fixed by adding another OID - usualy in/out bytes - math not working only with one OID]

    ERROR: Target[f1-http][_IN_] ‘1.3.6.1.4.1.14988.1.1.2.2.1.5. $target->[0]{$mode}  / 8′ (warn): Use of uninitialized value in division (/) at (eval 11) line 1.
    ERROR: Target[f1-http][_OUT_] ‘1.3.6.1.4.1.14988.1.1.2.2.1.5. $target->[0]{$mode}  / 8′ (warn): Use of uninitialized value in division (/) at (eval 12) line 1.

    1.3.6.1.4.1.14988.1.1.2.2.1.5.16777231:MRTG08@192.168.1.243 / 2176000 [before]

    1.3.6.1.4.1.14988.1.1.2.2.1.5.16777231&1.3.6.1.4.1.14988.1.1.2.2.1.6.16777231:MRTG08@192.168.1.243 / 2176000 [after]

    ERROR 4 :
    SYNTAX ERROR :
    [Fixed by removing ":" at the end of line 1, since using math formula no need ":" at the end]

    ERROR: Target[f1-http][_IN_] ‘1.3.6.1.4.1.14988.1.1.2.2.1.5. $target->[0]{$mode}  /2176000:’ (eval): syntax error at (eval 11) line 1, near “2176000:”

    ERROR: Target[f1-http][_OUT_] ‘1.3.6.1.4.1.14988.1.1.2.2.1.5. $target->[0]{$mode}  /2176000:’ (eval): syntax error at (eval 12) line 1, near “2176000:”

    a. rahman isnaini r.sutan

    Posted in MRTG, Script | No Comments »