AnsweredAssumed Answered

Perl script to check if the QID from the list of eight thousand QIDs are on the detected hosts

Question asked by Piotr Kaminski on Oct 29, 2014
Latest reply on Oct 31, 2014 by mcalvi

Hello

 

I need to wrote a script in Perl to checking if QID is existing on the hosts. I have a list of 8000 QID and need simple information witch QID from that list are on detected hosts. I don’t want the list of all hosts what contain those QID because it is around 2 GB of data . List of QIDs are changing every week. I need simple list like that

 

 

Input

QID

-------------------

1. 9090

2. 120202

3. 12312

.................

8000. 23290

 

output:

QID | exist

-------------------

1. 9090 | yes

2. 120202 | no

3. 12312 | yes

.................

8000. 23290| no

 

 

I was trying to do that  in that way:

 

curl -Y 5 -y 300 -s -H
"X-Requested-With: Curl" -o
"/test/id.xml" -u
"asd:asdasgfed"
"https://qualysapi.qualys.com/api/2.0/fo/asset/host/vm/detection/" -d
"action=list&qids=87110&output_format=CSV_NO_METADATA&suppress_duplicated_data_from_csv=0&status=Active&active_kernels_only=0&max_days_since_last_vm_scan="90"&truncation_limit=1"

 

 

What is working but very slow when QID was not detected it took 3 minutes to finish search . 8000 qid x 3 minutes it will take more then week to finish script.

 

I can run many queries at once, but maybe there is some another simple way to do that ?

Outcomes