Having troubles in uploading with archive now

Hi All

I’m just starting to use EIM and i’m having trouble with archive now…
Already read a lot of docs, and investigated here but still struggling …

So i have create an action that sends some files to a server then executes a shell script that generates a file with the output i want to send back to the EIM server.
The action returns complete 100% but i cannot find the file that should be uploaded to the server in the /var/opt/BESServer/UploadManagerData/BufferDir/sha1/67/15285467/

here is my code :


setting “_BESClient_ArchiveManager_OperatingMode”=“2” on “{now}” for client
setting”_BESClient_ArchiveManager_FileSet-send"="/OUT/linux-x86/send/ip.txt" on “{now}” for client
setting “_BESClient_ArchiveManager_SendAll”=“1” on “{now}” for client

prefetch 9be16a034b37537508afbfcf7aa0cc1fa4e4df6d sha1:9be16a034b37537508afbfcf7aa0cc1fa4e4df6d size:67894 http://ilmtpnc:52311/Uploads/9be16a034b37537508afbfcf7aa0cc1fa4e4df6d/linux-ix86.tmp sha256:1b918781ee1a56fd2d81a02081f34d4305db1bc33e9421f85ad5afc56e7e8571
folder create "/OUT/linux-ix86"
extract 9be16a034b37537508afbfcf7aa0cc1fa4e4df6d "/OUT/linux-ix86"
folder create “/OUT/linux-ix86/send"
wait /usr/bin/perl /OUT/linux-ix86/ip.pl
copy /OUT/linux-ix86/ip.pl.txt /OUT/linux-ix86/send/ip.txt
archive now

Any toughts or suggestions are welcome :smile:

Thanks in advance

What does this file contain?

Why are you uploading it to the root server at all?

You can just read the contents of the file into an analysis property if it is a short text file.

Hi,

In this example the file contains the IP addresses that the server has, but i have several other scripts to execute in servers to “discover” a lot of other information about the servers.
The option to put that info into properties that i can acess via the IEM API would be just perfect, can you give an example how to put that info into a server property ?

There are many properties built in to IEM / BigFix to report on lots of information already.

Here is one to get the IP addresses:

addresses of adapters of networks

Here is a more complicated example:

(friendly name of it, address of it) of adapters whose (address of it as string != "0.0.0.0" AND up of it AND not loopback of it) of network

What other information are you trying to discover?

It really sounds like uploading this file to the root server is the wrong thing to do and you should instead be reading this file with a IEM / BigFix property, particularly if it is a small file

It also seems like most of what are looking for can be done directly with relevance without the need to run anything on the endpoint at all.

Hi again,

For instance i want to discover :

  • databases instaled mostly Oracle and MSSQL.
  • Application Servers for instance - SAP Application Server, WebSphere instances.
  • Information about the HW (CPU, RAM , Serial Number)
  • Information about the Operating System (SO Name, Ip addresses, file systems / disks / mounts)

Can you give me some tips on how to “reading this file with a IEM / BigFix property” ?

And also if it is possible to query that “property” via the IEM API ?

I feel I should note that IEM has been renamed to BigFix.

1 Like

Yes, any results in a property or analysis can be queried using the BigFix REST API.

Everything you are looking for either already exists in a property provided by IBM, or an analysis on BigFix.Me or is one that could be written, or through this method:

Anything that cannot be queried natively by BigFix relevance can be accomplished by running something on the command line on a periodic basis, outputting the results to a file, then reading the lines of that file or parts of it using a relevance property. It is ideal if this is not required because it is much better to do it through relevance natively if possible.

Uploading a file to the root server is definitely the wrong approach for this.

Here is an analysis for MSSQL: https://bigfix.me/analysis/details/2994632

Here is one for the HOSTS file: https://bigfix.me/analysis/details/2994561

These are a ton of different hardware analyses in addition to the ones IBM already provides:

Here are ones specific to Hard Drives / Storage:

Analyses specific to Windows OS:

As far as I know, there do not exist ones for:

  • Oracle
  • SAP Application Server
  • WebSphere

These could be written if the information desired can be read from config files, registry, settings, other files, etc…

1 Like

I need to come up with a better “real” example, but here is some very rough pseudo code that shows the general process for how to put the output of a command into a file and how to read it with a property.


ActionScript:

wait cmd echo "Hello World!" > results_cmd_echo.log

Relevance for the Property:

lines whose("" != it as trimmed string) of files "results_cmd_echo.log"

This will not actually work as is. You need to store the output log somewhere. I highly recommend placing it within the BigFix Client Log folder, the location of which can be determined in a cross platform way using relevance substitution. I also recommend a naming convention similar to what I put above.

1 Like

Thanks for clarifying, BigFix it is !
Although the latest documentation (9.2) still refers to IEM …

1 Like

Thanks again, a lot of info to study.
Uploading the file isn’t an option an there are a lot of different approaches to put the info in BigFix so that i can extract that info to be used by another tool…

1 Like

Uploading a file using Archive Now is an option, it just isn’t a good option for what you are trying to accomplish.

Also, uploading using Archive Now will cause the storage to grow on the root server, which is okay if it is needed, but otherwise I would avoid it. It gets messy.

1 Like