How to build a SSA for Linux

HCL does not provide a SSA “Self Service Application” for Linux and this is a bummer for the people who use Linux. as there is some software we have that is not available in a standard Linux software repository or maybe the user wants to take some custom action on their machine like add the company desktop wallpaper.
so we came up with our own SSA for Linux on bigfix.

The way it works is the code below creates a GUI with a product icon, text which is the name of the software or action and a button for each line.
when you click a button it creates a text file.
you place this code into a file named SSA.py and push it out via a fixlet to the machines and place it on the desktop or other place where the users know to go to run it, when they want to open the the SSA.

We created a fixlet for each line item in the list, each fixlet either installs software or takes a custom action like adding corporate desktop wallpaper. at the end of each fixlet action we delete the text file, so it will not be relevant to the fixlet after it has already run, thus resetting the button.
Each fixlet’s relevance is set to look for the specific corresponding text file that is generated when a button is pushed and the fixlet action is set to never expire and no limit of times installed.

python must be installed on the target machines and you also must have the tkinter module installed in python.
create a folder named SSA and place it under /var and grant full rights to the users, and place the product icon images here via fixlet.

We hope this is helpful to bigfix operators who support Linux machines.
here is the python code we used.

import tkinter

from PIL import ImageTk, Image
import subprocess

master=tkinter.Tk()
master.title("grid() method")
master.geometry("700x600")
# - header -

def run1():
    subprocess.run(["touch", "/var/SSA/item1.txt"])

def run2():
    subprocess.run(["touch", "/var/SSA/item2.txt"])

def run3():
    subprocess.run(["touch", "/var/SSA/item3.txt"])

def run4():
    subprocess.run(["touch", "/var/SSA/item4.txt"])

def run5():
    subprocess.run(["touch", "/var/SSA/item5.txt"])

def run6():
    subprocess.run(["touch", "/var/SSA/item6.txt"])

def run7():
    subprocess.run(["touch", "/var/SSA/item7.txt"])

def run8():
    subprocess.run(["touch", "/var/SSA/item8.txt"])

def run9():
    subprocess.run(["touch", "/var/SSA/item9.txt"])


lblheader = tkinter.Label(master, text="  Bigfix: Self Service Application   ", bg="orange", fg="black", font=("Times", 35, "bold italic"))
lblheader.grid(column=0, row=0, columnspan=3, sticky='we')

lblblankline = tkinter.Label(master, text="")
lblblankline.grid(column=1, row=1, columnspan=3, sticky='w')

#....... Menu item 1
# Create a photoimage object of the image in the path
image1 = Image.open("/var/SSA/Adobe_Acrobat_DC_icon.png")

image1 = image1.resize((40, 40), Image.ANTIALIAS)
test = ImageTk.PhotoImage(image1)

label1 = tkinter.Label(image=test)
label1.image = test
# Position image
label1.place(x=80, y=70)

lblmenuitem1 = tkinter.Label(master, text=" Adobe Acrobat reader..........................", fg="black", font=("Times", 12, "bold"))
lblmenuitem1.grid(column=1, row=2, columnspan=3, sticky='w')

# create button
button1=tkinter.Button(master, text="Install", bd=3, command=run1)
button1.grid(row=2,column=2)

lblblankline = tkinter.Label(master, text="")
lblblankline.grid(column=1, row=3, columnspan=3, sticky='w')

#....... Menu item 2
image2 = Image.open("/var/SSA/corretto.png")
image2 = image2.resize((40, 40), Image.ANTIALIAS)
test2 = ImageTk.PhotoImage(image2)

label2 = tkinter.Label(image=test2)
label2.image = test2
# Position image
label2.place(x=80, y=115)

lblmenuitem2 = tkinter.Label(master, text=" Amazon Corretto Java.........................", fg="black", font=("Times", 12, "bold"))
lblmenuitem2.grid(column=1, row=4, columnspan=3, sticky='w')

button2=tkinter.Button(master, text="Install", bd=3, command=run2)
button2.grid(row=4,column=2)

lblblankline = tkinter.Label(master, text="")
lblblankline.grid(column=1, row=5, columnspan=3, sticky='w')

#....... Menu item 3
image3 = Image.open("/var/SSA/7zip.png")
image3 = image3.resize((40, 40), Image.ANTIALIAS)
test3 = ImageTk.PhotoImage(image3)

label3 = tkinter.Label(image=test3)
label3.image = test3
# Position image
label3.place(x=80, y=162)

lblmenuitem3 = tkinter.Label(master, text=" 7 Zip.....................................................", fg="black", font=("Times", 12, "bold"))
lblmenuitem3.grid(column=1, row=6, columnspan=3, sticky='w')

button3=tkinter.Button(master, text="Install", bd=3, command=run3)
button3.grid(row=6,column=2)

lblblankline = tkinter.Label(master, text="")
lblblankline.grid(column=1, row=7, columnspan=3, sticky='w')

#....... Menu item 4
image4 = Image.open("/var/SSA/filezilla.png")
image4 = image4.resize((40, 40), Image.ANTIALIAS)
test4 = ImageTk.PhotoImage(image4)

label4 = tkinter.Label(image=test4)
label4.image = test4
# Position image
label4.place(x=80, y=210)

lblmenuitem4 = tkinter.Label(master, text=" FileZilla.................................................", fg="black", font=("Times", 12, "bold"))
lblmenuitem4.grid(column=1, row=8, columnspan=3, sticky='w')

button4=tkinter.Button(master, text="Install", bd=3, command=run4)
button4.grid(row=8,column=2)

lblblankline = tkinter.Label(master, text="")
lblblankline.grid(column=1, row=9, columnspan=3, sticky='w')

#....... Menu item 5
image5 = Image.open("/var/SSA/icetea.png")
image5 = image5.resize((40, 40), Image.ANTIALIAS)
test5 = ImageTk.PhotoImage(image5)

label5 = tkinter.Label(image=test5)
label5.image = test5
# Position image
label5.place(x=80, y=260)

lblmenuitem5 = tkinter.Label(master, text=" Icedtea.................................................", fg="black", font=("Times", 12, "bold"))
lblmenuitem5.grid(column=1, row=10, columnspan=3, sticky='w')

button5=tkinter.Button(master, text="Install", bd=3, command=run5)
button5.grid(row=10,column=2)

lblblankline = tkinter.Label(master, text="")
lblblankline.grid(column=1, row=11, columnspan=3, sticky='w')

#....... Menu item 6
image6 = Image.open("/var/SSA/chrome.png")
image6 = image6.resize((40, 40), Image.ANTIALIAS)
test6 = ImageTk.PhotoImage(image6)

label6 = tkinter.Label(image=test6)
label6.image = test6
# Position image
label6.place(x=80, y=310)

lblmenuitem6 = tkinter.Label(master, text=" Chrome.................................................", fg="black", font=("Times", 12, "bold"))
lblmenuitem6.grid(column=1, row=14, columnspan=3, sticky='w')

button6=tkinter.Button(master, text="Install", bd=3, command=run6)
button6.grid(row=14,column=2)

lblblankline = tkinter.Label(master, text="")
lblblankline.grid(column=1, row=15, columnspan=3, sticky='w')

#....... Menu item 7
image7 = Image.open("/var/SSA/printer.png")
image7 = image7.resize((40, 40), Image.ANTIALIAS)
test7 = ImageTk.PhotoImage(image7)

label7 = tkinter.Label(image=test7)
label7.image = test7
# Position image
label7.place(x=80, y=360)

lblmenuitem7 = tkinter.Label(master, text=" Printer Logic.................................................", fg="black", font=("Times", 12, "bold"))
lblmenuitem7.grid(column=1, row=16, columnspan=3, sticky='w')

button7=tkinter.Button(master, text="Install", bd=3, command=run7)
button7.grid(row=16,column=2)

lblblankline = tkinter.Label(master, text="")
lblblankline.grid(column=1, row=17, columnspan=3, sticky='w')


#....... Menu item 8
image8 = Image.open("/var/SSA/Displaylink driver.png")
image8 = image8.resize((40, 40), Image.ANTIALIAS)
test8 = ImageTk.PhotoImage(image8)

label8 = tkinter.Label(image=test8)
label8.image = test8
# Position image
label8.place(x=80, y=410)

lblmenuitem8 = tkinter.Label(master, text=" Displaylink driver for desks monitor arms", fg="black", font=("Times", 12, "bold"))
lblmenuitem8.grid(column=1, row=18, columnspan=3, sticky='w')

button8=tkinter.Button(master, text="Install", bd=3, command=run8)
button8.grid(row=18,column=2)

lblblankline = tkinter.Label(master, text="")
lblblankline.grid(column=1, row=19, columnspan=3, sticky='w')

#....... Menu item 9
image9 = Image.open("/var/SSA/wallpaper.png")
image9 = image9.resize((40, 40), Image.ANTIALIAS)
test9 = ImageTk.PhotoImage(image9)

label9 = tkinter.Label(image=test9)
label9.image = test9
# Position image
label9.place(x=80, y=460)

lblmenuitem9 = tkinter.Label(master, text="Wallpaper.............................................", fg="black", font=("Times", 12, "bold"))
lblmenuitem9.grid(column=1, row=20, columnspan=3, sticky='w')

button9=tkinter.Button(master, text="Install", bd=3, command=run9)
button9.grid(row=20,column=2)

lblblankline = tkinter.Label(master, text="")
lblblankline.grid(column=1, row=21, columnspan=3, sticky='w')


master.mainloop()
2 Likes

I edited your post to put in the ‘code’ tags.

thank you you for the help!