Automatic reporting of installed software (e.g., via email)

Share your tips or issues concerning the WAPT Console or WAPT Agent here
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
Remi Pinck
Messages: 2
Registration: Oct 06, 2016 - 09:11

October 6, 2016 - 9:18 AM

Hello,

we have been using Wapt with satisfaction for some time now.
Currently, users do not have the admin password to install new programs except in certain special cases (developers, etc.).
For these "special cases," we would like to have an automatic report of new software installed during the day so that we can remove pirated software as quickly as possible.
Is there a way to do this with Wapt?

Thank you and have a good day

, Rémi Pinck
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

October 7, 2016 - 3:32 PM

Remi Pinck wrote:Hello,

we have been using Wapt with satisfaction for some time now.
Currently, users do not have the admin password to install new programs except in certain special cases (developers, etc.).
For these "special cases," we would like to have an automatic report of new software installed during the day so that we can remove pirated software as quickly as possible.


Is there a way to do this with Wapt?

One could easily imagine a package that installs itself every time the machine shuts down

computer shutdown script:

Code: Select all

 wapt-get install -f tis-scanpackage 


And this program scans the software list each time; if the software list has changed since the last scan, the package sends the name of the affected software via email with blat

So yes, it's possible
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

October 7, 2016 - 4:37 PM

Here's a small example script to put in c;\wapt\softaudit.py that does the job...

Then, in a command prompt, run `waptpython c:\wapt\softaudit.py --days=5`

Code: Select all

import sys,os
from common import *
from getpass import getpass
from optparse import OptionParser

def compact_date(adatetime=None):
    if adatetime is None:
        adatetime = datetime.datetime.today()
    return adatetime.strftime('%Y%m%d')

if __name__ == '__main__':
    parser=OptionParser(usage="Sample script which check softwares installed recently on wapt registred computers")
    parser.add_option("-c","--config", dest="config", default=os.path.join(os.path.dirname(sys.argv[0]),'wapt-get.ini') , help="Config file full path (default: %default)")
    parser.add_option("-d","--days", dest="days", default=1, type='int', help="Days back to look at (default: %default)")
    (options,args) = parser.parse_args()

    server_password = getpass('Please input wapt server admin password:')

    # initialise wapt api with local config file
    wapt = Wapt(config_filename = options.config)
    wapt.dbpath=':memory:'

    # get the collection of *all* hosts from waptserver inventory
    hosts =  wapt.waptserver.get('api/v1/hosts?columns=uuid,host.computer_fqdn',auth=('admin',server_password))

    print(u'Logiciels installés depuis %s jours sur les %s machines de wapt:\n'%(options.days,len(hosts['result'])))
    for h in hosts['result']:
        try:
            uuid = h['uuid']

            hostname = h['host']['computer_fqdn']
            ip = ','.join(h['host']['connected_ips'])
            description = h['host']['description']

            softs = wapt.waptserver.get('api/v1/host_data?uuid=%s&field=softwares'%(uuid,),auth=('admin',server_password)).get('result',[])
            datemin = compact_date(datetime.datetime.now()-datetime.timedelta(days=options.days)) # forme YYYYMMDD 20161007
            recent_installs = [s['name'] for s in softs if s['install_date'] >= datemin]
            if recent_installs:
                print "%s (%s)  %s:\n    %s\n" %(hostname,ip,description,'\n    '.join(recent_installs))
        except Exception as e:
            print " error %s" % e
Attachments
softaudit.zip
(1.1 KB) Downloaded 428 times
Tranquil IT
Floflobel
Messages: 135
Registration: Oct 15, 2015 - 5:32 p.m.

October 10, 2016 - 10:22

Hello,

it's very difficult to put the WAPT admin password in plain text. Someone with even a little technical knowledge could easily guess it.
Isn't there another solution?

Sincerely,
Remi Pinck
Messages: 2
Registration: Oct 06, 2016 - 09:11

October 13, 2016 - 10:34

Hello,

thank you for the script suggestion (I will forward it to the admin who manages the project).
Indeed, the password issue still needs to be resolved.

Have a good day,

Rémi.
Locked