Monit script example1/18/2024 EndGrid () #Adds an OK and Cancel button to the dialog dg. AddControlToGrid ( "TextBox2", "TextControl", "", 1, 3 ) dg. AddControlToGrid ( "L4", "LabelControl", "I'm another label.", 1, 2, "A tooltip", expand = False ) dg. AddControlToGrid ( "元", "LabelControl", "I'm another label.", 1, 1, "A tooltip", expand = False ) dg. AddControlToGrid ( "L2", "LabelControl", "I'm another label.", 1, 0, "A tooltip", expand = False ) dg. AddControlToGrid ( "TextBox1", "TextControl", "", 0, 1, colSpan = 3 ) dg. AddControlToGrid ( "L1", "LabelControl", "I'm a label.", 0, 0, "A tooltip", expand = False ) dg. SetTitle ( "Example Deadline Script" ) dg. Here is an example of adding two buttons to a dialog and keeping them to the far right of the dialog.įrom import DeadlineScriptDialog dg = None def _main_ ( * args ): """Main Function Called By Deadline""" global dg dg = DeadlineScriptDialog () dg. If you want to space controls out in the grid you can use labels filled with white space, or you can use horizontal spacers. Here is an example of what the dialog would look like expanded horizontally if all controls had “expand=False” set. Here is an example of what this dialog would look like expanded vertically: Here is an example of what this dialog would look like expanded horizontally: This will result in the dialog losing its layout when it is expanded. That this will cause the cells in the grid that the controls are in to expand without allowing any of the controls to expand with it. Note that if you set all controls in a row to not expand Nothing will grow, other than the dialog itself, when expanding vertically. When you expand the dialog horizontally, only the text controls will grow in the above example. The second rowĬontains three labels that are not allowed to grow in the first three columns and a text control in the fourth column that can grow as needed.ĭg. The first row contains a label in the first column and is set to not grow any bigger than it needs to and a text control that spans the next 3 columns and is allowed to grow. This is an example of a dialog with two rows and four columns. By default controls have “expand” set and have their “colSpan” and “rowSpan” properties set to 1. If you want a control to take more space you can set the control span multiple rows or columns using “rowSpan” and “colSpan”, You want certain elements to not grow within a row you can set the “expand” property to be disabled. The contents of the grid(s) will automatically adjust themselves to share the size of the dialog. It is not possible to specify the size of the controls you want to add to the grid, however it is also not necessary to do so. Here is an example of what this dialog would look like: AddControlToGrid ( "TextBox1", "TextControl", "", 0, 1 ) dg. AddControlToGrid ( "Label1", "LabelControl", "I'm a label.", 0, 0, "A tooltip", False ) dg. The application should be able to come up automatically.Ī good practice is to put the start/stop scripts to the same directory where the application is deployed.Dg. The reason for that is the situation when the server get’s rebooted. We all know that each application need an start script. I would recommend to spend some time with Monit’s documentation. 1 # Monit configuration 2 3 check matching "" 4 start program = "/bin/su -c '/usr/lib//current/bin/start.sh'" 5 stop program = "/bin/su -c '/usr/lib//current/bin/stop.sh'" 6 # CPU 7 if cpu > 5% for 2 cycles then alertĨ # RAM 9 if mem > 80 MB for 5 cycles then alertġ0 11 # Check if the application directory exists 12 check directory -dir path /usr/lib//current/ġ7 18 # - 19 # Configuration 20 # Check if the configuration directory is present 21 check -conf-dir path /usr/lib//current/config/Ģ6 27 # Check if the unicorn configuration file is present 28 check -conf-file-unicorn with path /usr/lib//current/config/unicorn.rbģ4 35 # - 36 # Logs 37 # Check if the log file is present 38 check file -log-file path /var/log//access.log
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |