viernes, 6 de enero de 2012

Spiceworks Agent (a.k.a. Stand-Alone Data Collector)

NOTE: It is now nearing the end of 2011, and we have completed internal development of a lighter weight Spiceworks agent. Look for beta testing for this to start in early 2012. Until we get through beta testing though, the approach below should still work for you.
This article will help you use the stand-alone data collection feature of Spiceworks. This can be used to gather information from remote machines that don't check in very often, or from machines that are not connected to the network. (Windows Only)
Please note: If you read an older version of this it said to copy msvcrt-ruby18.dll, in 3.5 that changed. You need to copy spiceworks.dll now instead.
1.

On your Spiceworks Server copy the following directories

* Program Files\Spiceworks\pkg
* Program Files\Spiceworks\lib
2.

Place these in a new directory wherever you want.

i.e. on a usb stick, or on the network somewhere
3.

In this new directory create a \bin directory.

4.

Copy the following files from the Spiceworks Server to \bin.

* bin\spiceworks-finder.exe
* bin\sqlite3.dll
* bin\spiceworks.dll
* bin\iconv.dll
* bin\zlib1.dll
* bin\ssleay32.dll
* bin\libeay32.dll
* bin\qdbm.dll
5.

Rename spiceworks-finder.exe to sagent.exe.

6.

Create \data\computers in the new directory.

7.

Your directory\file structure should now look somewhat like this:

\
\bin
\bin\iconv.dll
\bin\libeay32.dll
\bin\spiceworks.dll
\bin\sqlite3.dll
\bin\qdbm.dll
\bin\ssleay32.dll
\bin\zlib1.dll
\bin\sagent.exe
\data\computers
\lib
\pkg
*Please note: The lib and pkg directories should contain all sub directories and files from the Spiceworks Server.
8.

The Commands

* The newly renamed sagent.exe is the core of the scanner. Run sagent.exe from the command line.
Flags for sagent.exe
-v = Verbose Output
-P = Http Port
-Q = Https Port (bonus - data is sent over https to your server)
-S = Server
-s '' = No Server (dash s followed by two single quotes)
-i = run in interactive mode
-i import = Import .yaml file to Spiceworks Server
--help = Show all flags
(Full set of flags shown in image. This is for version 2.0)
Sagenthelp_big
9.

Collecting Data

sagent.exe -P HTTP_PORT -s SERVER -v
or
sagent.exe -Q HTTPS_PORT -s SERVER -v
or
sagent.exe -s SERVER_URL -v
Where HTTP_PORT is the http port of your Spiceworks installation on SERVER or HTTPS_PORT is the https port.
You can also specify a SERVER_URL in the form of http://SERVER:HTTP_PORT orhttps://SERVER:HTTPS_PORT
where the default ports are 80 and 443 respectively.
The -v flag gives verbose logging output and is optional.
This should send the data for this machine to your Spiceworks server.
The following command:
sagent -s '' -i
will run the agent on the local machine and create a .yaml file for you to import on the server.
Here is how to import the .yaml file on the server.
spiceworks-finder.exe -i import ..\data\computers\PCNAME.yaml
On your Server, several things won't work right. You will not be able to run a rescan from the GUI, the online/offline status won't work, and probably several other things."

Conclusion

I don't know everything there is to know about this, so feel free to PM me or add comments with further information. This is a great addition to Spiceworks that few people know about. Also, please check the References below, they contain a lot more information and some other tips and tricks.

No hay comentarios:

Publicar un comentario