Jump to content

Check machine status as on or off


Recommended Posts

Hi,

    I want to check the remote computer is on or off remotely, from my computer. Any solution for this?

I have used 'ping' to check this. But, When DHCP enabled for a computer, it gives different results in local system and in remote system. 

When DHCP has assigned some ip address, which address will be taken priority? static or dynamic? In dynamic , how to give consistent results in all machines where script runs?

On local system it shows correct result. But machine is on, and dynamic address is taken. then machine status is 'off' for static ipaddress. For both systems, it should run correctly. 

Any Help is appreciated and thanks in advance.

Thanks,

 

Link to comment
Share on other sites

Could you give some examples of the output you are getting and where it is different? How you explain it does not really make sense - the interface address will either be static or dynamic not both, unless you have multiple but even then the static will remain online.

Link to comment
Share on other sites

In WMI, I am generating XML file. XML file has nodes which displays machinename with ip address ans machine status,

ip address is changed here.This is static address. On local machine ,displays

<MachineName>ABC</MachineName><IPADDRESS>192.168.1.10</IPADDRESS><ServerStatus>OFF</ServerStatus>

when this script is run on another machine, for another machine configuration, it shows 

<MachineName>ABC</MachineName><IPADDRESS>169.254.110.20</IPADDRESS><ServerStatus>ON</ServerStatus>

In reality, machine is ON, but for local system, ip address is static , so it shows OFF.

How to map static to dynamic ipaddresses in WMI?

 

Link to comment
Share on other sites

@shilpa,

welcome to AutoIt and to the forum!

first, are you aware of the fact that there are plenty of monitoring apps out there? (i'm talking about the good free ones, not the expensive enterprise garbage)

but if you insist on doing so yourself, than your solution is to perform the monitoring by hostname.

second, where are you getting the XML data from? are you querying a DHCP server? are you querying a management server of some sort? note that the machine producing the data is the one getting the IP info. so, even if a machine has a static IP address, if you query the DHCP you may get the obsolete lease, which is invalid.

 

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi.

In case testing and PINGed host are on the same LAN segment (no routing required), my suggestion is to

  • resolve hostname to IP using the buildin function TCPNameToIP()
  • PING the host
  • read the testing host's arp cache to check, if the destination host was arpable.

By doing so it's not important wheather ICMP (PING) is allowed to be answered by the destination host's firewall settings

 

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...