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
Automatic reporting of installed software (e.g., via email)
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
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
- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
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
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`
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
-
Remi Pinck
- Messages: 2
- Registration: Oct 06, 2016 - 09:11
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.
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.
