Overblog Tous les blogs Top blogs Entreprises & Marques Tous les blogs Entreprises & Marques
Editer l'article Suivre ce blog Administration + Créer mon blog
MENU
http://nlkgh.over-blog.com/

nlkgh.over-blog.com/

Publicité

Script Debugger 7 0 100



Version 7.0: FREE SCRIPT DEBUGGER LITE The biggest change in Script Developer 7 is the release of our new 'lite' mode, which offers all the basic editing, debugging and dictionary functions that you need to write your code. Even without Script Debugger's advanced features, it represents a significant improvement over the Script Editor. I'm trying to debug some VBScript and normally I'd install the ancient (but free) Microsoft Script Debugger which would work fine on 32-bit XP and 32-bit Windows 7. However after installing it on 64-bit Windows 7 neither //d or //x (or even both) actually invoke the debugger any more.

You can run the Icinga 2 daemon with the -X (--script-debugger)parameter to enable the script debugger:

When an exception occurs or the debuggerkeyword is encountered in a user script, Icinga 2 launches a console thatallows the user to debug the script.

You can also attach the script debugger to the configuration validation:

Here is a list of common errors which can be diagnosed with the script debugger:

  • Configuration errors e.g. apply rules
  • Errors in user-defined functions

Debugging Configuration Errors ¶

The following example illustrates the problem of a service apply rulewhich expects a dictionary value for config, but the host custom variable onlyprovides a string value:

The error message on config validation will warn about the wrong value type,but does not provide any context which objects are affected.

Enable the script debugger and run the config validation:

You can print the variables vars and config to get an idea abouttheir values:

The vars attribute has to be a dictionary. Trying to set this attribute to a string causedthe error in our configuration example.

In order to determine the name of the host where the value of the config variable came fromyou can inspect attributes of the service object:

Microsoft script debugger free download

Emulsion 1 3 4 download free. Additionally you can view the service object attributes by printing the value of this.

Using Breakpoints ¶

In order to halt execution in a script you can use the debugger keyword:

Icinga 2 will spawn a debugger console every time the function is executed:

Debugging API Filters ¶

Queries against the Icinga 2 REST API can usefilters, just like available in assign where expressions. If these filters causean internal error, they return an empty result to the caller.

In order to analyse these server-side errors, you can use the script debugger.

The following example tries filter for all host objects where the custom variableos https://arab-free413.hatenablog.com/entry/2020/12/15/193742. is set. There are various possibilities to check that, one of them would behost.vars.os != '. Another idea is to use the contains method on the customattribute dictionary like this: host.vars.contains('os').

This will fail on all hosts which don't have any custom variable specified.

By definition, a type method can only be invoked on an actual object.

Windows Script Debugger Download

In order to stay safe, add more checks to the API filter:

Microsoft Script Debugger Windows 10

  • host.vars && host.vars.contains('os') or
  • host.vars && typeof(host.vars) Dictionary && host.vars.contains('os')

Script Debugger 7

Example:





Publicité
Partager cet article
Repost0
Pour être informé des derniers articles, inscrivez vous :
Commenter cet article