I want to build something that does a ping scan with nmap periodically to detect hosts showing up and dropping off the network. Is there an easy way to read the nmap output for Ruby? My preference is avoiding 3rd party libraries.
Thanks a lot!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have learned that simply employing backticks around the command will allow me to capture the output as a variable:
test =
nmap -sP 192.168.1.0/24p ‘test:’
puts test.split(“\n”)
Seems to work perfectly. However, as bonsaiviking pointed out, it would be wise to investigate nmap’s XML functionality.