Open-AudIT

What's on your network?
It is currently Wed Jan 24, 2018 8:00 am

All times are UTC + 10 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Feb 04, 2016 6:24 am 
Offline
Newbie

Joined: Wed Oct 28, 2015 11:18 pm
Posts: 3
Hi. I have an infrastructure with a lot of offline computers. So we need to insert/update devices using XMLs generated by scripts. On the web interface (version 1.8.2) I can see that it is possible to add a single computer using XML (audit result) or add a single device manually (form) or add multiple devices using XLS. My question is: Is there a way to add multiple computers using just multiple XMLs that I have?


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 04, 2016 7:03 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1229
I don't think there is anything for this right now.

It should be fairly simple to write a script to cycle through a directory of XML files, post the data and remove or archive the files using the same mechanism that all the audit scripts use to post XML.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 18, 2016 6:49 pm 
Offline
Newbie
User avatar

Joined: Wed Nov 12, 2014 6:57 pm
Posts: 14
Location: Frankfurt a.M., Germany
I wrote a bash script for this purpose a while ago, you can use it and change it as you please:

Code:
#!/bin/bash
# Aim: submit manually created Open-Audit files to Auditserver
#
# usage example: find * -name '*.xml' -exec ls submit_host.sh {} \;

AUDIT_URL=<URL to auditserver>/index.php/system/add_system
EXPECTED_ARGS=1
WGET=`which wget`

if [ $# -ne $EXPECTED_ARGS ]
then
  echo "Usage: $0 hostname-<date>.xml"
  exit $E_BADARGS
fi

# append metadata
#form_systemXML=
sed -i '1s/^/form_systemXML=/' "$1"

# fix special chars
sed -i -e 's/+/%2B/g' "$1"
sed -i -e 's/"/%22/g' "$1"
sed -i -e 's/&/%26/g' "$1"

$WGET --post-file=$1 $AUDIT_URL 2>/dev/null

# switch back to std xml
sed -i -e 's/form_systemXML=//g' "$1"
sed -i -e 's/%2B/+/g' "$1"
sed -i -e 's/%22/"/g' "$1"
sed -i -e 's/%26/&/g' "$1"

_________________
Server Info:
OS : Ubuntu 14.04
Auditing: ~ 500 machines (35 Windows Server, 440 Linux Server)
LDAP: not yet
Version: Open-AudIT Version 1.8.4


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: Mark and 5 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group