Extinction message packet

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
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
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

April 14, 2020 - 3:12 PM

Hello everyone,

Here is the package we use to display a message prompting the user to restart the computer:

setup.py file

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
import wmi
import locale

uninstallkey = []

#récupération de la langue du système
Language = locale.getdefaultlocale()
Language = Language[0]

#sélection du language à afficher
if Language == 'fr_FR' :
    DisplayMsg7 = "Ce poste n\'a pas ete redemarre depuis 7 jours, merci de le redemarrer \r Le service informatique"
    DisplayMsg15 = "Ce poste n\'a pas ete redemarre depuis 15 jours, merci de le redemarrer, avant son redemarrage automatique par nos soins \r Le service informatique"
elif Language == 'en_US' :
    DisplayMsg7 = "This computer has not been rebooted for 7 days, please reboot \r IT service"
    DisplayMsg15 = "This computer has not been rebooted for 15 days, please reboot, before reboot will be initiated by us \r IT service"
else :
    DisplayMsg7 = "Ce poste n\'a pas ete redemarre depuis 7 jours, merci de le redemarrer \r Le service informatique"
    DisplayMsg15 = "Ce poste n\'a pas ete redemarre depuis 15 jours, merci de le redemarrer, avant son redemarrage automatique par nos soins \r Le service informatique"

def install():
    print('installing tls-message-arret')

def audit():
    #Récupération de la date du dernier démarrage
    LastBoot = str(wmi_as_struct(wmi.WMI().Win32_OperatingSystem.query(fields=['LastBootUpTime'])))

    #Récupération de la date en chiffre
    Date = int(currentdate())
    LastBoot = int(LastBoot[21:29])

    #Comparaison entre la date actuelle et celle du boot, si + 7 jours affichage du message
    if (Date - LastBoot) > 15 :
        run('msg * %s' %(DisplayMsg15))
        return "ERROR"
    elif (Date - LastBoot) > 7 :
        run('msg * %s' %(DisplayMsg7))
        return "WARNING"
    else :
        return "OK"
Control file:

Code: Select all

package           : -message-arret
version           : 1.0-1
architecture      : all
section           : base
priority          : optional
name              :
categories        :
maintainer        : Gaëtan
description       : Displays a pop up if the computer has not been restarted since 7 days and 15 days
depends           :
conflicts         :
maturity          : PROD
locale            : fr,en
target_os         :
min_os_version    :
max_os_version    :
min_wapt_version  :
sources           :
installed_size    :
impacted_process  :
description_fr    : Affiche une pop up si le poste n'a pas été redemarré depuis 7 jours et 15 jours
description_pl    :
description_de    :
description_es    :
description_pt    :
description_it    :
description_nl    :
description_ru    :
audit_schedule    : 60m
editor            :
keywords          :
licence           :
homepage          :
package_uuid      : 
valid_from        :
valid_until       :
forced_install_on :
We have changed the audit interval to every hour.
Last edited by Gaetan on Apr 15, 2020 - 10:28, edited 1 time.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

April 14, 2020 - 6:32 PM

Haha, awesome, I approve! ;)
User avatar
vcardon
WAPT Expert
Messages: 278
Registration: Oct 06, 2017 - 10:55 p.m.
Location: Nantes, France

April 14, 2020 - 9:16 PM

sfonteneau wrote: Apr 14, 2020 - 6:32 PM Haha, awesome, I approve ;)
Simon, Gaëtan, how could we make this package international, rather than strictly French? That way, we can make it a universal WAPT package :) because the same need exists everywhere.

VC
Vincent CARDON
Tranquil IT
PierreC
Messages: 6
Registration: August 2, 2018 - 4:09 PM

April 15, 2020 - 8:40 AM

For your information, the package hasn't been thoroughly tested here yet due to a lack of time to deploy it globally before the isolation phase. I'd prefer an incremental response starting on day 8, something like a message every 4 hours on day 8, every 2 hours on day 9, and so on.
I'm not entirely sure about the procedure yet; our users are generally a bit averse to updates, and I want to prepare them a little so that WAPT doesn't become an enemy with harmful long-term habits. It's already been observed that our users have gotten into the habit of closing the update window every time they shut down, so we really need to educate them on these topics, and this package should clearly illustrate this need without becoming a "the IT department annoys me, I reboot my machine, close the window, and I'm good for a week" situation.
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

April 15, 2020 - 10:30 AM

Hello Simon and Vincent,
thank you for your feedback.
I have updated the first message with language support (only FR and EN).
Locked