Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Nmap
-
OklahomaGreyBeard
- Posts: 6
- Joined: Sun Mar 29, 2015 12:35 pm
Re: Nmap
Sorry Pako, I know I'm asking questions all over the place but I'm on a roll and the more I figure out, the more I can do with it.
I'm using the nmap plugin to turn lights on or off upon leaving and arriving home and also setting variables to check if anyone else is home. ie. don't turn off the lights when I leave if the wife is still home. It all works great with one exception that happened this morning. The pc updated and rebooted. Upon the start of EG, it does not trigger the device connecting event which I use to set the variable. I set an action in autorun to get the status of one of the devices, but it does not trigger an event and I don't know how to access the current status of the device.
The device I'm testing with is MikesS5Active and I have it setting a status of 0/1.
How do I check if the status is 0 or 1 in my python script so I can set or increase my variable of someoneshome?
I used to program in PHP and C++ years ago but this old brain is trying to get back in the swing of things after a few years of shunning technology.(long story) Learning python is a bit challenging but I'm getting there.
-GB
I'm using the nmap plugin to turn lights on or off upon leaving and arriving home and also setting variables to check if anyone else is home. ie. don't turn off the lights when I leave if the wife is still home. It all works great with one exception that happened this morning. The pc updated and rebooted. Upon the start of EG, it does not trigger the device connecting event which I use to set the variable. I set an action in autorun to get the status of one of the devices, but it does not trigger an event and I don't know how to access the current status of the device.
The device I'm testing with is MikesS5Active and I have it setting a status of 0/1.
How do I check if the status is 0 or 1 in my python script so I can set or increase my variable of someoneshome?
I used to program in PHP and C++ years ago but this old brain is trying to get back in the swing of things after a few years of shunning technology.(long story) Learning python is a bit challenging but I'm getting there.
-GB
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Nmap
It is very easy.OklahomaGreyBeard wrote:How do I check if the status is 0 or 1 in my python script so I can set or increase my variable of someoneshome?
It might look like this:
Code: Select all
if eg.result:
print "Present"
else:
print "Absent"You know flattr ? You can 

-
OklahomaGreyBeard
- Posts: 6
- Joined: Sun Mar 29, 2015 12:35 pm
Re: Nmap
Exactly what I needed, works like a charm. Thanks.
Re: Nmap
Hello Pako,
I'm a bit confused, I've installed Nmap program and then I installed the plugin (The path in configuration is also correct) I use IPrange: **.*.*.0/24 and I find all my clients that are connected - but when I press WIfI OFF on my phone I do not get any event on eventghost that the phone has gone away.
Know what might cause this?
EDIT: I think it's working now, did a complete reinstall. Only thing is that it's very slow to update, like 5-10 mins or so I think.
I'm a bit confused, I've installed Nmap program and then I installed the plugin (The path in configuration is also correct) I use IPrange: **.*.*.0/24 and I find all my clients that are connected - but when I press WIfI OFF on my phone I do not get any event on eventghost that the phone has gone away.
Know what might cause this?
EDIT: I think it's working now, did a complete reinstall. Only thing is that it's very slow to update, like 5-10 mins or so I think.
Re: Nmap
Hi team,
I'm having a little trouble here getting this plugin to work.
I have Windows 10 and the latest EventGhost install.
This plugin successfully loads in Eg.
Unfortunately no devices appear in the Devices list even though I have successfully scanned them in NMap itself.
What would cause my devices to appear in the NMap front end but not in the python plugin Named Devices List?
Is there a block being put in place by Win10 perhaps?
- Wayne (@Tameion)
I'm having a little trouble here getting this plugin to work.
I have Windows 10 and the latest EventGhost install.
This plugin successfully loads in Eg.
Unfortunately no devices appear in the Devices list even though I have successfully scanned them in NMap itself.
What would cause my devices to appear in the NMap front end but not in the python plugin Named Devices List?
Is there a block being put in place by Win10 perhaps?
- Wayne (@Tameion)
Re: Nmap
It suddenly becomes clear.
I was expecting it to be filled automatically but once I read the word MANUAL in your reply it suddenly became obvious.
I commend you on your excellent work with plugins and commitment to ongoing support and development.
Thanks again Pako
- Wayne
I was expecting it to be filled automatically but once I read the word MANUAL in your reply it suddenly became obvious.
I commend you on your excellent work with plugins and commitment to ongoing support and development.
Thanks again Pako
- Wayne
Re: Nmap
Okay further to our earlier conversation Pako I now have the boxes populated and that end of the plugin seems to work just fine but I am not getting any results displayed and returned to me
I am using the following short python prog to display results immediately after executing a Npap:Get MAC Address request on a permanently connected device (10.1.1.2)
print "Result = " + eg.result
print "String = " + eg.event.string
print "Prefix = " + eg.event.prefix
When I use the commands I get this result in the log:
18:55:38 Nmap: Get MAC address: 10.1.1.2
18:55:38 Nmap: Get MAC address: 10.1.1.2
18:55:38 Python Script
18:55:38 Device is Present
18:55:38 Result = IP address "10.1.1.2" not present
Similarly if I execute any other Nmap command I get the same results
Can someone explain how this works.
My Eventghost .XML section is follows:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1710">
<Macro Name="Nmap: Get MAC address: 10.1.1.2" Expanded="True">
<Action>
Nmap.GetMacAddress(u'10.1.1.2')
</Action>
<Action>
EventGhost.PythonScript(u'\nif eg.result:\n print "Device is Present"\nelse:\n print "Device is Absent"\n\nprint "Result = " + eg.result\nprint "String = " + eg.event.string\nprint "Prefix = " + eg.event.prefix\nprint eg.event.time\nprint "Suffix = " + eg.event.suffix\nprint "Souece = " + eg.event.source\nprint "isEnded = " + eg.event.isEnded\nprint "Payload = " + eg.event.payload')
</Action>
</Macro>
</EventGhost>
I am using the following short python prog to display results immediately after executing a Npap:Get MAC Address request on a permanently connected device (10.1.1.2)
print "Result = " + eg.result
print "String = " + eg.event.string
print "Prefix = " + eg.event.prefix
When I use the commands I get this result in the log:
18:55:38 Nmap: Get MAC address: 10.1.1.2
18:55:38 Nmap: Get MAC address: 10.1.1.2
18:55:38 Python Script
18:55:38 Device is Present
18:55:38 Result = IP address "10.1.1.2" not present
Similarly if I execute any other Nmap command I get the same results
Can someone explain how this works.
My Eventghost .XML section is follows:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1710">
<Macro Name="Nmap: Get MAC address: 10.1.1.2" Expanded="True">
<Action>
Nmap.GetMacAddress(u'10.1.1.2')
</Action>
<Action>
EventGhost.PythonScript(u'\nif eg.result:\n print "Device is Present"\nelse:\n print "Device is Absent"\n\nprint "Result = " + eg.result\nprint "String = " + eg.event.string\nprint "Prefix = " + eg.event.prefix\nprint eg.event.time\nprint "Suffix = " + eg.event.suffix\nprint "Souece = " + eg.event.source\nprint "isEnded = " + eg.event.isEnded\nprint "Payload = " + eg.event.payload')
</Action>
</Macro>
</EventGhost>
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Nmap
There may be several reasons, and it is difficult to find the cause from afar.
I have a few questions:
1) What is the IP address of a PC running EventGhost?
2) The command ping 10.1.1.2 is successful?
3) If you run nmap (Zenmap) directly, then the device with the address 10.1.1.2 is there to see?
Pako
I have a few questions:
1) What is the IP address of a PC running EventGhost?
2) The command ping 10.1.1.2 is successful?
3) If you run nmap (Zenmap) directly, then the device with the address 10.1.1.2 is there to see?
Pako
You know flattr ? You can 

Re: Nmap
PAKO - PLEASE SEE NEXT POST
C:\Users\Wayne>ping 10.1.1.2
Pinging 10.1.1.2 with 32 bytes of data:
Reply from 10.1.1.2: bytes=32 time=1ms TTL=64
Reply from 10.1.1.2: bytes=32 time=1ms TTL=64
Reply from 10.1.1.2: bytes=32 time=1ms TTL=64
Reply from 10.1.1.2: bytes=32 time=1ms TTL=64
Ping statistics for 10.1.1.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
Everything runs at both ends but it seems that the communication between Nmap and EventGhost is not happening
When I execute a command in EG it shows up in the log but nothing else happens
When I query the eg.result variable in EG immediately after execution of a plugin command it returns only information I have entered in the plugin setup and no other status results are collected from NMap
EG Nmap plugin commands asking to open dialogue boxes etc execute in the log but no other results appear.
This is what an EventGhost variable dump gives me
10.1.1.10 it is on the same subnet mask as the target.1) What is the IP address of a PC running EventGhost?
YES....2) The command ping 10.1.1.2 is successful?
C:\Users\Wayne>ping 10.1.1.2
Pinging 10.1.1.2 with 32 bytes of data:
Reply from 10.1.1.2: bytes=32 time=1ms TTL=64
Reply from 10.1.1.2: bytes=32 time=1ms TTL=64
Reply from 10.1.1.2: bytes=32 time=1ms TTL=64
Reply from 10.1.1.2: bytes=32 time=1ms TTL=64
Ping statistics for 10.1.1.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
Yes... nmap gives all extensive details for the device3) If you run nmap (Zenmap) directly, then the device with the address 10.1.1.2 is there to see?
Everything runs at both ends but it seems that the communication between Nmap and EventGhost is not happening
When I execute a command in EG it shows up in the log but nothing else happens
When I query the eg.result variable in EG immediately after execution of a plugin command it returns only information I have entered in the plugin setup and no other status results are collected from NMap
EG Nmap plugin commands asking to open dialogue boxes etc execute in the log but no other results appear.
This is what an EventGhost variable dump gives me
Any suggestions?15:12:16 Nmap: Get MAC address: 10.1.1.2
15:12:16 Nmap: Get MAC address: 10.1.1.2
15:12:16 Event Ghost Variables
15:12:16 eg.result = IP address "10.1.1.2" not present
15:12:16 eg.string = Main.OnCmdExecute
15:12:16 eg.prefix = Main
15:12:16 eg.time = 395.734811221
15:12:16 eg.suffix = OnCmdExecute
15:12:16 eg.source = <dynamic-module 'eg'>
15:12:16 eg.isEnded = False
15:12:16 eg.payload = None
Last edited by tameion on Thu Dec 31, 2015 2:29 am, edited 1 time in total.
Re: Nmap
Pako I rebooted my system and then reinstalled NMap
It now works ....
I suspect it is because Windows needs a reboot for the system PATH variable to be actioned after installation adds the NMap location details.
As others seem to have experienced this issue I suggest you may like to add a note to your first post that a system reboot is required and possibly reinstalling could solve any additional problems.
I am excited about the opportunities your plugin provides me for my home automation projects.
Again many thanks.
- Wayne
It now works ....
I suspect it is because Windows needs a reboot for the system PATH variable to be actioned after installation adds the NMap location details.
As others seem to have experienced this issue I suggest you may like to add a note to your first post that a system reboot is required and possibly reinstalling could solve any additional problems.
I am excited about the opportunities your plugin provides me for my home automation projects.
Again many thanks.
- Wayne
-
Henrik4223
- Posts: 47
- Joined: Fri Mar 04, 2016 10:18 am
Re: Nmap
Dear Pako
This plugin is without a doubt the best plugin I have - thank you very much for making it!!!
I only have one small issue with it. If I restart EG og my computer Nmap does not start by sending the EVENT corresponding to my group (empty or incomplete). I am sure this is possible, but I have no experience with python.
I looked at this script, but it does not send any events:
if eg.result:
print "Present"
else:
print "Absent"
How do I make Nmap send the event Empty or Incomplete?
This plugin is without a doubt the best plugin I have - thank you very much for making it!!!
I only have one small issue with it. If I restart EG og my computer Nmap does not start by sending the EVENT corresponding to my group (empty or incomplete). I am sure this is possible, but I have no experience with python.
I looked at this script, but it does not send any events:
if eg.result:
print "Present"
else:
print "Absent"
How do I make Nmap send the event Empty or Incomplete?
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Nmap
I know this question was to Pako but allow me to suggest a solution 
To get information about a group status Pako has provided a getter action called "Get group status". You can use this in a python script typically like this:
This will give you the group state result in the payload. If you would rather like to have it in the event suffix, the following code can be used:
Next step is to run this script at startup. You can put it in the Autostart tree directly (but not above the Nmap plugin!) or what maybe looks cleaner, in a separate macro where you add the event 'Main.OnInit'
To get information about a group status Pako has provided a getter action called "Get group status". You can use this in a python script typically like this:
Code: Select all
gState = eg.plugins.Nmap.GetGroupState(u'name of your group', 0)
eg.TriggerEvent(
'GroupState',
payload = gState,
prefix = 'Nmap'
)
Code: Select all
gState = eg.plugins.Nmap.GetGroupState(u'name of your group', 0)
eg.TriggerEvent(
gState,
payload = None,
prefix = 'Nmap'
)
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Nmap
1) I'm glad you used the plugin. I expected more interested users, but it did not.Henrik4223 wrote:How do I make Nmap send the event Empty or Incomplete?
2) Maybe you do not have a corresponding option unticked.3) Note that even if you will have this option unticked, events Empty and Incomplete does not appear immediately, but only after a preset time ( Security factor * Scanning period).
Pako
You know flattr ? You can 
