forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Picture or color change

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
kc7aad
Contributor
Contributor


Joined: 09 Oct 2005
Posts: 53
Location: Spokane Washington

PostPosted: Fri Nov 10, 2006 12:51 am    Post subject: Picture or color change Reply with quote

So I know it can be done.. But since I haven't been in touch with my "Programming Side" lately, I cannot figure out how for the life of me!!

In one of my programs, I want to change a picture, or at least the color of a picture from green to red. I am trying to create an automatic Ping piece of software that will at a variable interval, go out and ping the variable list of IP's or DNS entries. If one comes back and isn't preset, the picture would change to red, then also send an alert to me thru a pre-specified batch file.
The list i want to be able to have is about 10 IP's long, and I already have the program built, I just can't figure out how to associate a picture if one state, and another if another, then send the alert.

Make sense?? Good lord, i hope so!!

Any ideas, folks??



Thanks in advance!!

Rod Ekholm
kc7aad at ewarg dot org
Back to top
View user's profile Send private message Yahoo Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Nov 10, 2006 2:01 am    Post subject: Reply with quote

isn't it the case of having 2 coloured bmp images (one read and one green saved as red.bmp and green.bmp) and then you just display the relevant one depending on the result of the ping?

another way is to have them both displayed and hide the one you don't want displayed following a ping

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Fri Nov 10, 2006 2:15 am    Post subject: Reply with quote

I use vdsipp.dll. So I'd use:

Code:
  INTERNET ICMP,CREATE,1
  INTERNET ICMP,THREADS,1,OFF
  INTERNET ICMP,HOSTLOOKUP,1,OFF
  INTERNET ICMP,TRANSFERMODE,1,0
  INTERNET ICMP,PING,1,%%Address
  if @greater(@INTERNET(ICMP,BYTES,1),31)
    # Ping OK
    if %%NoPing
      dialog hide,redbmp
      dialog show,greenbmp
    end
    %%NoPing =
  else
    # Ping Failed
    if @null(%%NoPing)
      dialog hide,greenbmp
      dialog show,redbmp
    end
    %%NoPing = 1
  end
  INTERNET ICMP,DESTROY,1

_________________
cheers

Dave


Last edited by DaveR on Fri Nov 10, 2006 1:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
kc7aad
Contributor
Contributor


Joined: 09 Oct 2005
Posts: 53
Location: Spokane Washington

PostPosted: Fri Nov 10, 2006 4:59 am    Post subject: Reply with quote

See!! I every time.. you guys come thru!! I know VDS was a great purchase, if for nothing else, the forum support!!!!!


Thanks,

Rod
Back to top
View user's profile Send private message Yahoo Messenger
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 169
Location: Spain

PostPosted: Fri Nov 10, 2006 3:28 pm    Post subject: Reply with quote

It is but easy still if an SHAPE element is used. We can use "DIALOG SET, SHAPE1, background color;border color". This way:

Code:

  INTERNET ICMP,CREATE,1
  INTERNET ICMP,THREADS,1,OFF
  INTERNET ICMP,HOSTLOOKUP,1,OFF
  INTERNET ICMP,TRANSFERMODE,1,0
  INTERNET ICMP,PING,1,%%Address
  if @greater(@INTERNET(ICMP,BYTES,1),31)
    # Ping OK
    if %%NoPing
      dialog set,shape1,green;black
    end
    %%NoPing =
  else
    # Ping Failed
    if @null(%%NoPing)
      dialog set,shape1,red;black
    end
    %%NoPing = 1
  end
  INTERNET ICMP,DESTROY,1
Back to top
View user's profile Send private message Visit poster's website
kc7aad
Contributor
Contributor


Joined: 09 Oct 2005
Posts: 53
Location: Spokane Washington

PostPosted: Fri Nov 10, 2006 4:40 pm    Post subject: Reply with quote

OK.. so now the problem I am facing is the parsing of the data! Here is a screenshot of what It comes back with in my list1 windows, but how do I get the PARSE function to only recongnize cetain areas?? I am a LOT confused about this step!!

Thanks



netmon.gif
 Description:
Network Monitor Screenshot
 Filesize:  9.87 KB
 Viewed:  26445 Time(s)

netmon.gif


Back to top
View user's profile Send private message Yahoo Messenger
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Fri Nov 10, 2006 7:50 pm    Post subject: Reply with quote

Can you post the code you are having trouble with?

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
kc7aad
Contributor
Contributor


Joined: 09 Oct 2005
Posts: 53
Location: Spokane Washington

PostPosted: Mon Nov 13, 2006 4:37 am    Post subject: Reply with quote

I sure can!! Cause I know you all can help!!!
But its kinda long... You should be able to run it and see where it is at.
For the time being, I have created a list box, so I can see the results manually. However, The end result I am hoping for is basically that if an IP Address or DNS Name is not pingable, or returns a value of something greater than 1 second, It will change the indicator to red. Or if it less than 1 second, then use the Green indicator.
The next step to this, would be to run a script, and alert me thru an in house paging system that %%MACHINEX%% is not responding. Hoping to use this in my servers.

Anyways.. he you go.. Hope this helps somewhat!!
As you can see... I've commented some things out so I could debug some things..
Code:

Title Results
  DIALOG CREATE,Network Monitor,-1,0,500,440,SMALLCAP
  DIALOG ADD,GROUP,GROUP1,0,120,14,173,
REM *** Modified by Dialog Designer on 11/8/2006 - 14:56 ***
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %A = @INIREAD(NET1,IP)
  %B = @INIREAD(NET2,IP,)
  %C = @INIREAD(NET3,IP,)
  %D = @INIREAD(NET4,IP,)
  %E = @INIREAD(NET5,IP,)
  %F = @INIREAD(NET6,IP,)
  %G = @INIREAD(NET7,IP,)
  %H = @INIREAD(NET8,IP,)
  %I = @INIREAD(NET9,IP,)
  %J = @INIREAD(NET10,IP,)
  INIFILE CLOSE
  DIALOG ADD,BUTTON,EDIT,0,0,64,16,EDIT
  DIALOG ADD,BUTTON,QUIT,0,136,64,16,QUIT
  DIALOG ADD,BUTTON,RUN1,16,136,64,16,RUN1
  DIALOG ADD,TEXT,TEXT1,16,1,,,%A
  DIALOG ADD,BUTTON,RUN2,32,136,64,16,RUN2
  DIALOG ADD,TEXT,TEXT2,32,1,,,%B
  DIALOG ADD,BUTTON,RUN3,48,136,64,16,RUN3
  DIALOG ADD,TEXT,TEXT3,48,1,,,%C
  DIALOG ADD,BUTTON,RUN4,62,136,64,16,RUN4
  DIALOG ADD,TEXT,TEXT4,62,1,,,%D
  DIALOG ADD,BUTTON,RUN5,78,136,64,16,RUN5
  DIALOG ADD,TEXT,TEXT5,78,1,,,%E
  DIALOG ADD,BUTTON,RUN6,94,136,64,16,RUN6
  DIALOG ADD,TEXT,TEXT6,94,1,,,%F
  DIALOG ADD,BUTTON,RUN7,110,136,64,16,RUN7
  DIALOG ADD,TEXT,TEXT7,110,1,,,%G
  DIALOG ADD,BUTTON,RUN8,126,136,64,16,RUN8
  DIALOG ADD,TEXT,TEXT8,126,1,,,%H
  DIALOG ADD,BUTTON,RUN9,142,136,64,16,RUN9
  DIALOG ADD,TEXT,TEXT9,142,1,,,%I
  DIALOG ADD,BUTTON,RUN10,158,136,64,16,RUN10
  DIALOG ADD,TEXT,TEXT10,158,1,,,%J
#  DIALOG ADD,BITBTN,RG,0,121,10,10,RG.BMP
#  DIALOG ADD,BITBTN,GRN1,18,121,10,10,GRN.BMP
#  DIALOG ADD,BITBTN,RED1,18,121,10,10,RED.BMP
#  DIALOG ADD,BITBTN,GRN2,34,121,10,10,GRN.BMP
#  DIALOG ADD,BITBTN,RED2,34,121,10,10,RED.BMP
#  DIALOG ADD,BITBTN,GRN3,50,121,10,10,GRN.BMP
#  DIALOG ADD,BITBTN,RED3,50,121,10,10,RED.BMP
#  DIALOG ADD,BITBTN,GRN4,64,121,10,10,GRN.BMP
#  DIALOG ADD,BITBTN,RED4,64,121,10,10,RED.BMP
#  DIALOG ADD,BITBTN,GRN5,80,121,10,10,GRN.BMP
#  DIALOG ADD,BITBTN,RED5,80,121,10,10,RED.BMP
#  DIALOG ADD,BITBTN,GRN6,96,121,10,10,GRN.BMP
#  DIALOG ADD,BITBTN,RED6,96,121,10,10,RED.BMP
#  DIALOG ADD,BITBTN,GRN7,112,121,10,10,GRN.BMP
#  DIALOG ADD,BITBTN,RED7,112,121,10,10,RED.BMP
#  DIALOG ADD,BITBTN,GRN8,128,121,10,10,GRN.BMP
#  DIALOG ADD,BITBTN,RED8,128,121,10,10,RED.BMP
#  DIALOG ADD,BITBTN,GRN9,144,121,10,10,GRN.BMP
#  DIALOG ADD,BITBTN,RED9,144,121,10,10,RED.BMP
#  DIALOG ADD,BITBTN,GRN10,160,121,10,10,GRN.BMP
#  DIALOG ADD,BITBTN,RED10,160,121,10,10,RED.BMP
  DIALOG ADD,STYLE,STYLE1,ARIAL,10,,BLACK,LTGREEN
  DIALOG ADD,STYLE,STYLE2,ARIAL,10,YELLOW,BLUE
  DIALOG ADD,LIST,LIST1,180,0,500,240,,STYLE1
  DIALOG SHOW
:Evloop
  wait event
  goto @event()
:RGBUTTON
  GOTO EVLOOP
:RED1BUTTON
  GOTO EVLOOP
:GRN1BUTTON
  GOTO EVLOOP
:RED2BUTTON
  GOTO EVLOOP
:GRN2BUTTON
  GOTO EVLOOP
:RED3BUTTON
  GOTO EVLOOP
:GRN3BUTTON
  GOTO EVLOOP
:RED4BUTTON
  GOTO EVLOOP
:GRN4BUTTON
  GOTO EVLOOP
:RED5BUTTON
  GOTO EVLOOP
:GRN5BUTTON
  GOTO EVLOOP
:RED6BUTTON
  GOTO EVLOOP
:GRN6BUTTON
  GOTO EVLOOP
:RED7BUTTON
  GOTO EVLOOP
:GRN7BUTTON
  GOTO EVLOOP
:RED8BUTTON
  GOTO EVLOOP
:GRN8BUTTON
  GOTO EVLOOP
:RED9BUTTON
  GOTO EVLOOP
:GRN9BUTTON
  GOTO EVLOOP
:RED10BUTTON
  GOTO EVLOOP
:GRN10BUTTON
  GOTO EVLOOP
:EDITBUTTON
  RUN Notepad "\Program Files\Network Monitor\netmon.ini"
  goto evloop
:RUN1BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN1
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %A = @INIREAD(NET1,IP)
  %%VA = @INIREAD(NET1,VA)
  INIFILE CLOSE
  DIALOG SET,TEXT1,%A
  RUNH PING %A %%VA,PIPE
  %P = @PIPE()
#  DIALOG HIDE,RED1
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN1
  GOTO EVLOOP
:RUN2BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN2
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %B = @INIREAD(NET2,IP)
  %%VB = @INIREAD(NET2,VB)
  INIFILE CLOSE
  DIALOG SET,TEXT2,%B
  RUNH PING %B %%VB,PIPE
  %P = @PIPE()
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN2
  GOTO EVLOOP
:RUN3BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN3
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %C = @INIREAD(NET3,IP)
  %%VC = @INIREAD(NET3,VC)
  INIFILE CLOSE
  DIALOG SET,TEXT3,%C
  RUNH PING %C %%VC,PIPE
  %P = @PIPE()
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN3
  GOTO EVLOOP
:RUN4BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN4
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %D = @INIREAD(NET4,IP)
  %%VD = @INIREAD(NET4,VD)
  INIFILE CLOSE
  DIALOG SET,TEXT4,%D
  RUNH PING %D %%VD,PIPE
  %P = @PIPE()
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN4
  GOTO EVLOOP
:RUN5BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN5
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %E = @INIREAD(NET5,IP)
  %%VE = @INIREAD(NET5,VE)
  INIFILE CLOSE
  DIALOG SET,TEXT5,%E
  RUNH PING %E %%VE,PIPE
  %P = @PIPE()
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN5
  GOTO EVLOOP
:RUN6BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN6
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %F = @INIREAD(NET6,IP)
  %%VF = @INIREAD(NET6,VF)
  INIFILE CLOSE
  DIALOG SET,TEXT6,%F
  RUNH PING %F %%VF,PIPE
  %P = @PIPE()
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN6
  GOTO EVLOOP
:RUN7BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN7
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %G = @INIREAD(NET7,IP)
  %%VG = @INIREAD(NET7,VG)
  INIFILE CLOSE
  DIALOG SET,TEXT7,%G
  RUNH PING %G %%VG,PIPE
  %P = @PIPE()
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN7
  GOTO EVLOOP
:RUN8BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN8
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %H = @INIREAD(NET8,IP)
  %%VH = @INIREAD(NET8,VH)
  INIFILE CLOSE
  DIALOG SET,TEXT8,%H
  RUNH PING %H %%VH,PIPE
  %P = @PIPE()
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN8
  GOTO EVLOOP
:RUN9BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN9
INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %I = @INIREAD(NET9,IP)
  %%VI = @INIREAD(NET9,VI)
  INIFILE CLOSE
  DIALOG SET,TEXT9,%I
  RUNH PING %I %%VI,PIPE
  %P = @PIPE()
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN9
  GOTO EVLOOP
:RUN10BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN10
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %J = @INIREAD(NET10,IP)
  %%VJ = @INIREAD(NET10,VJ)
  INIFILE CLOSE
  DIALOG SET,TEXT10,%J
  RUNH PING %J %%VJ,PIPE
  %P = @PIPE()
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN10
  GOTO EVLOOP
:QUITBUTTON
  goto CLOSE
:Close
  exit



I have also included the .ini file it is calling, so you can run it and see what I have so far. Not sure if it will help, but im hopin'!!


Rod Twisted Evil
Back to top
View user's profile Send private message Yahoo Messenger
kc7aad
Contributor
Contributor


Joined: 09 Oct 2005
Posts: 53
Location: Spokane Washington

PostPosted: Mon Nov 13, 2006 4:41 am    Post subject: Reply with quote

OK.. So it looks like the attachment didnt post, so here is the ini file in plain text...

[NET1]
IP=192.168.1.1
VA=-n 1
:
[NET2]
IP=192.168.1.100
VB=-n 1
:
[NET3]
IP=192.168.1.139
VC=-n 1
:
[NET4]
IP=192.168.1.127
VD=-n 1
:
[NET5]
IP=EWARG.ORG
VE=-n 10
:
[NET6]
IP=www.kc7aad.com
VF=-n 1
:
[NET7]
IP=GOOGLE.COM
VG=-n 1
:
[NET8]
IP=CCBTECH3
VH=-n 1
:
[NET9]
IP=DENAB
VI=-n 1
:
[NET10]
IP=ccbdatagator
VJ=-n 1


Rod
Back to top
View user's profile Send private message Yahoo Messenger
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Mon Nov 13, 2006 6:53 am    Post subject: Reply with quote

Code:
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN1
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %A = @INIREAD(NET1,IP)
  %%VA = @INIREAD(NET1,VA)
  DIALOG SET,TEXT1,%A
  RUNH PING %A %%VA,PIPE
  %P = @PIPE()
  list create,2
  list append,2,%P
  if @greater(@count(2),0)
    list seek,2,0
    if @not(@match(2,Received = 0))
      DIALOG HIDE,RED1
    end 
  end
  list close,2
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN1
  GOTO EVLOOP

_________________
cheers

Dave
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Mon Nov 13, 2006 7:00 am    Post subject: Reply with quote

Or

Code:
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN1
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %A = @INIREAD(NET1,IP)
  %%VA = @INIREAD(NET1,VA)
  DIALOG SET,TEXT1,%A
  RUNH PING %A %%VA,PIPE
  %P = @PIPE()
  list create,2
  list append,2,%P
  if @greater(@count(2),0)
    list seek,2,0
    if @not(@match(2,Received = 0))
      DIALOG HIDE,RED1
    end 
    list seek,2,0
    if @not(@match(2,Average = 1000ms))
      DIALOG HIDE,RED1
    end 
  end
  list close,2
  LIST ASSIGN,LIST1,%P
  DIALOG ENABLE,RUN1
  GOTO EVLOOP

_________________
cheers

Dave
Back to top
View user's profile Send private message
kc7aad
Contributor
Contributor


Joined: 09 Oct 2005
Posts: 53
Location: Spokane Washington

PostPosted: Tue Nov 14, 2006 5:01 am    Post subject: Reply with quote

Thanks Dave.. But when i replace the code i had in there, it works to some extent. If I ping something that is present in less than 1 second, it does turn green. But if the remote machine all of a sudden disappears, it wont turn back red. Did I miss something??? Or not add something i sould have??


Thanks
Back to top
View user's profile Send private message Yahoo Messenger
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Tue Nov 14, 2006 2:41 pm    Post subject: Reply with quote

Try this:
Code:
:RUN1BUTTON
  LIST CLEAR,LIST1
  DIALOG DISABLE,RUN1
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %A = @INIREAD(NET1,IP)
  %%VA = @INIREAD(NET1,VA)
  DIALOG SET,TEXT1,%A
  RUNH PING %A %%VA,PIPE
  %P = @PIPE()
  LIST ASSIGN,LIST1,%P
  list create,2
  list append,2,%P
  if @greater(@count(2),0)
    list seek,2,0
    if @match(2,could not find)
      DIALOG SHOW,RED1
    else
      list seek,2,0
      if @not(@match(2,Received = 0))
        DIALOG HIDE,RED1
      else
        DIALOG SHOW,RED1
      end 
      list seek,2,0
      if @match(2,Average))
        option fieldsep,=
        %X = @item(2)
        parse "%A;%B;%C;%D",%X
        %X = @substr(%D,1,-2)
        if %X
          if @greater(%X,1000)
            DIALOG SHOW,RED1
          else
            DIALOG HIDE,RED1
          end
        end
      end
    end 
  end
  list close,2
  DIALOG ENABLE,RUN1
  GOTO EVLOOP

_________________
cheers

Dave
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Tue Nov 14, 2006 3:07 pm    Post subject: Reply with quote

BTW I got sick of copying, pasting and editing for each of the 10 buttons so I stripped 300 lines out of your code by creating a user command. Now you only have to edit in one place.

Code:

  Title Results

  #DEFINE COMMAND,PingResult

  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  %A = @INIREAD(NET1,IP)
  %B = @INIREAD(NET2,IP,)
  %C = @INIREAD(NET3,IP,)
  %D = @INIREAD(NET4,IP,)
  %E = @INIREAD(NET5,IP,)
  %F = @INIREAD(NET6,IP,)
  %G = @INIREAD(NET7,IP,)
  %H = @INIREAD(NET8,IP,)
  %I = @INIREAD(NET9,IP,)
  %J = @INIREAD(NET10,IP,)

  DIALOG CREATE,Network Monitor,-1,0,500,440,ONTOP
  DIALOG ADD,GROUP,GROUP1,0,120,14,173,
  DIALOG ADD,BUTTON,EDIT,0,0,64,16,EDIT
  DIALOG ADD,BUTTON,QUIT,0,136,64,16,QUIT
  DIALOG ADD,BUTTON,RUN1,16,136,64,16,RUN1
  DIALOG ADD,TEXT,TEXT1,16,1,,,%A
  DIALOG ADD,BUTTON,RUN2,32,136,64,16,RUN2
  DIALOG ADD,TEXT,TEXT2,32,1,,,%B
  DIALOG ADD,BUTTON,RUN3,48,136,64,16,RUN3
  DIALOG ADD,TEXT,TEXT3,48,1,,,%C
  DIALOG ADD,BUTTON,RUN4,62,136,64,16,RUN4
  DIALOG ADD,TEXT,TEXT4,62,1,,,%D
  DIALOG ADD,BUTTON,RUN5,78,136,64,16,RUN5
  DIALOG ADD,TEXT,TEXT5,78,1,,,%E
  DIALOG ADD,BUTTON,RUN6,94,136,64,16,RUN6
  DIALOG ADD,TEXT,TEXT6,94,1,,,%F
  DIALOG ADD,BUTTON,RUN7,110,136,64,16,RUN7
  DIALOG ADD,TEXT,TEXT7,110,1,,,%G
  DIALOG ADD,BUTTON,RUN8,126,136,64,16,RUN8
  DIALOG ADD,TEXT,TEXT8,126,1,,,%H
  DIALOG ADD,BUTTON,RUN9,142,136,64,16,RUN9
  DIALOG ADD,TEXT,TEXT9,142,1,,,%I
  DIALOG ADD,BUTTON,RUN10,158,136,64,16,RUN10
  DIALOG ADD,TEXT,TEXT10,158,1,,,%J
#  DIALOG ADD,BITBTN,RG,0,121,10,10,RG.BMP
  DIALOG ADD,BITBTN,GRN1,18,121,10,10,GRN.BMP
  DIALOG ADD,BITBTN,RED1,18,121,10,10,RED.BMP
  DIALOG ADD,BITBTN,GRN2,34,121,10,10,GRN.BMP
  DIALOG ADD,BITBTN,RED2,34,121,10,10,RED.BMP
  DIALOG ADD,BITBTN,GRN3,50,121,10,10,GRN.BMP
  DIALOG ADD,BITBTN,RED3,50,121,10,10,RED.BMP
  DIALOG ADD,BITBTN,GRN4,64,121,10,10,GRN.BMP
  DIALOG ADD,BITBTN,RED4,64,121,10,10,RED.BMP
  DIALOG ADD,BITBTN,GRN5,80,121,10,10,GRN.BMP
  DIALOG ADD,BITBTN,RED5,80,121,10,10,RED.BMP
  DIALOG ADD,BITBTN,GRN6,96,121,10,10,GRN.BMP
  DIALOG ADD,BITBTN,RED6,96,121,10,10,RED.BMP
  DIALOG ADD,BITBTN,GRN7,112,121,10,10,GRN.BMP
  DIALOG ADD,BITBTN,RED7,112,121,10,10,RED.BMP
  DIALOG ADD,BITBTN,GRN8,128,121,10,10,GRN.BMP
  DIALOG ADD,BITBTN,RED8,128,121,10,10,RED.BMP
  DIALOG ADD,BITBTN,GRN9,144,121,10,10,GRN.BMP
  DIALOG ADD,BITBTN,RED9,144,121,10,10,RED.BMP
  DIALOG ADD,BITBTN,GRN10,160,121,10,10,GRN.BMP
  DIALOG ADD,BITBTN,RED10,160,121,10,10,RED.BMP
  DIALOG ADD,STYLE,STYLE1,ARIAL,10,,BLACK,LTGREEN
  DIALOG ADD,STYLE,STYLE2,ARIAL,10,YELLOW,BLUE
  DIALOG ADD,LIST,LIST1,180,0,500,240,,STYLE1
  DIALOG SHOW

:Evloop
  wait event
  goto @event()

:RGBUTTON
:RED1BUTTON
:GRN1BUTTON
:RED2BUTTON
:GRN2BUTTON
:RED3BUTTON
:GRN3BUTTON
:RED4BUTTON
:GRN4BUTTON
:RED5BUTTON
:GRN5BUTTON
:RED6BUTTON
:GRN6BUTTON
:RED7BUTTON
:GRN7BUTTON
:RED8BUTTON
:GRN8BUTTON
:RED9BUTTON
:GRN9BUTTON
:RED10BUTTON
:GRN10BUTTON
  GOTO EVLOOP

:EDITBUTTON
  RUN Notepad "\Program Files\Network Monitor\netmon.ini"
  goto evloop

:RUN1BUTTON
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  PingResult 1,@INIREAD(NET1,IP),@INIREAD(NET1,VA)
  goto evloop

:RUN2BUTTON
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  PingResult 2,@INIREAD(NET2,IP),@INIREAD(NET2,VB)
  goto evloop

:RUN3BUTTON
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  PingResult 3,@INIREAD(NET3,IP),@INIREAD(NET3,VC)
  goto evloop

:RUN4BUTTON
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  PingResult 4,@INIREAD(NET4,IP),@INIREAD(NET4,VD)
  goto evloop

:RUN5BUTTON
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  PingResult 5,@INIREAD(NET5,IP),@INIREAD(NET5,VE)
  goto evloop

:RUN6BUTTON
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  PingResult 6,@INIREAD(NET6,IP),@INIREAD(NET6,VF)
  goto evloop

:RUN7BUTTON
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  PingResult 7,@INIREAD(NET7,IP),@INIREAD(NET7,VG)
  goto evloop

:RUN8BUTTON
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  PingResult 8,@INIREAD(NET8,IP),@INIREAD(NET8,VH)
  goto evloop

:RUN9BUTTON
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  PingResult 9,@INIREAD(NET9,IP),@INIREAD(NET9,VI)
  goto evloop

:RUN10BUTTON
  INIFILE OPEN,\PROGRAM FILES\NETWORK MONITOR\NETMON.INI
  PingResult 10,@INIREAD(NET10,IP),@INIREAD(NET10,VJ)
  goto evloop

:QUITBUTTON
:Close
  exit
 
:PingResult
  if @both(@numeric(%1),@both(%2,%3))
    LIST CLEAR,LIST1
    DIALOG DISABLE,RUN%1
    DIALOG SET,TEXT%1,%2
    RUNH PING %2 %3,PIPE
    %P = @PIPE()
    LIST ASSIGN,LIST1,%P
    list create,2
    list append,2,%P
    if @greater(@count(2),0)
      list seek,2,0
      if @match(2,could not find)
        DIALOG SHOW,RED%1
      else
        list seek,2,0
        if @not(@match(2,Received = 0))
          DIALOG HIDE,RED%1
        else
          DIALOG SHOW,RED%1
        end 
        list seek,2,0
        if @match(2,Average))
          option fieldsep,=
          %X = @item(2)
          parse "%A;%B;%C;%D",%X
          %X = @substr(%D,1,-2)
          if %X
            if @greater(%X,1000)
              DIALOG SHOW,RED%1
            else
              DIALOG HIDE,RED%1
            end
          end
        end
      end 
    end
    DIALOG ENABLE,RUN%1
    list close,2
  else
    warn Missing Parameters!    ,
  end
  exit

_________________
cheers

Dave
Back to top
View user's profile Send private message
kc7aad
Contributor
Contributor


Joined: 09 Oct 2005
Posts: 53
Location: Spokane Washington

PostPosted: Wed Nov 15, 2006 4:51 am    Post subject: Reply with quote

!!!Thanks Dave!!!

It worked like a champ!! Now I need to figure it out!!
If anyone is interested in the end product, please let me know. It will be able to (Hopefully!!) email, or send an SMS Message to a cell phone. In my particular case, it will send a message to my in house paging terminal, and notify me that way.

Thanks to all who have helped and given input on this!! I sure appreciate it!


Rod Ekholm
kc7aad
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group