Client Management Suite

 View Only

{CWoC} Software Delivery Execution Trending 

Feb 17, 2014 11:48 AM

[END OF "SUPPORT" NOTICE]

Hello everyone, after close to 5 years maintaining various tools around Symantec Connect this legacy is turning to be more of a burden than anything else.

It's still is a great set of tool and they all have their use, but as such I'm not going to maintain them anymore.

The source code for this tool may still change over time, and can be found on Github: https://github.com/somewhatsomewhere?tab=repositories

[/END OF "SUPPORT" NOTICE]

Introduction

Depending on your environment Software Delivery Executions are taking place many times a day, ranging from a few hundred to ten's of housand. You can review the Software Delivery Execution per policy on the Symantec Management Platform via reports, however there is no easy way to evaluate how well or bad a deployment is going over time (or find out if any deployment is encountering issue).

This tool will provide you with access to such data. The aim here is simple: provide a quick and easy to browse web-site with hourly execution charts showing  success, errors and total counts over times.

Top

Design

I like to keep my design minimalistics, so not unlike Patch Trending [1] or aila2 [2], this tool is based on a back-end executable that must run on the server (using a Symantec Administrator account) and a web-front end that consumes the data generated by the back end.

In this specific tool, the back end is named "SWDExecTrending.exe" and produces a javascript file (in fact it outputs the data to stdout, and we save it by redirecting the output to a file) that is later consumed by a web-apge named "index.html". The javascript should be named "trending_data.js" and stored in the same directory as the index.html file.

The User Interface is a minimalistic web-page that consumes the javascript data and draw trending charts from the hourly tables. As usual it is based on the Google Chart API [3].

Top

Usage

SWDExecTrending.exe

SWD Execution Trending - JavaScript builder, version 2
Usage:

    SWDExecTrending --version | /version
        Print out the version of this tool.

    SWDExecTrending /raw
        Run the tool without filtering the data by _eventTime. The default
        filter removes events dated in the future and older than 30 days.

    SWDExecTrending
        Invoke this tool with no command line arguments. It will automatically
        read the content of EvT_AeX_SWD_Execution and will produce a JavaScript
        string to stdout.

    Output: The javascript defines a global variable named object_count that
    matches the count of Policy Execution for which trending data was generated
    (100 max).

    Each policy execution trend data will match the following outline:

        var top_n = { // where n is the row id
            "name" : "<SWD Policy name>",
            " stats" : {
                "hourly" : [
                    ["Date", "Total", "Success", "Error"],
                    [ ... ], // Hourly statistics for the Policy
                    [ ... ],
                    [ ... ]
                ]
            }
        }

    The policies are order by execution count in descending order, limited to
    100 at most. The SQL was adjusted to take care of special cases:

        * Data that indicates the Policy execution took place in the future
            is not included
        * Data going back more than 30 days is not included

    The first is to avoid computers that are operating with an invalid date
    from disrupting the trend graphs, the later is to avoid computers coming
    back from long period of inactivity from disrupting the trend graphs (this
    is especially needed for SWD policies such as the "Windows System Asses-
    -sment Scan" that is largely deployed and almost always running on
    computers.

    The program returns 0 if it produces any JavaScript output.
    The program returns 1 if it prints out command line help or version message.
    The program returns -1 if the user is not member of the Altiris Admini-
    -strator group.

Top

Index.html

You can either use index.html directly (double-clicking it to open it with your favourite web-browser) or via a web page. We'll details the later use now.

As previously describe the index.html file must be located in the same directory as the trending_data.js file. You can put both of these in a folder, for example "C:\inetpub\wwwwroot\SWDTrending".

Then you need to make sure in IIS that index.html is accepted as a default document.

Once this is done you can navigate to http://localhost/swdtrending/ and you should be able to browse thru you SWD Execution trending site! If the page refuses to load make sure you can access it directly: http://localhost/swdtrending/index.html.

Top

Navigation

With a maximum of 100 charts to display it was ot possible to put all charts into a single page (well, it is possible but it would not be wise, as generating the charts in Internet Explorer is done in one pass and then rendering takes place) [4].

As such we need to use page navigation, and to keep the design as simple as possible and as fluid (i.e. with the need to scroll left and right to navigate I wanted to avoid down scroll on top of that) I have settle on a table view that by default contains 3 rows of 2 charts. This can be changed on the html code to 5x2, or even mopre if you are ready to tweak the Html and JS.

Here is how it look on the first page:

SWDTrending-sampleIII.png

Any page scroll to the right will generate a "Previous page" link on the top left of the page, and the "Next page" link will disappear once you reach the last avialbale page.

Top

Conclusion

You can now easily build a web page inside you SMP console to review SWD Execution trends for your day-to-day operations to find out if any deployment is going wrong. But this is not the end of it. I sure intend to expand this tool to provide a better landing page so you can select which policy to view, or which page to satrt with, and possibly integrate the tool as a context-menu entry inside the SMP copnsole.

Top

References

[1] Patch trending

[3] Google Chart API

[4] SWD Trending blog entry

Top

Document history

2014-02-27: Version 2 released. Attached the build, source code and updated the command line help.

2014:02-17: Version 1 released. Created the base document and attached the build + source files.

Top

Statistics
0 Favorited
0 Views
4 Files
0 Shares
0 Downloads
Attachment(s)
zip file
SWDExecTrending-Source.zip   6 KB   1 version
Uploaded - Feb 25, 2020
zip file
SWDExecTrending-version1.zip   6 KB   1 version
Uploaded - Feb 25, 2020
zip file
SWDExecTrending-version2.zip   5 KB   1 version
Uploaded - Feb 25, 2020
zip file
SWDExecTrending-version2-source.zip   94 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Comments

Mar 06, 2014 02:29 PM

Thanks for the feedback Claus,

I already have an update ready for this tool, so I'll try to answer your need before publishing an update here on Connect.

Hopefully you'll have something before the end of next week ;-).

Mar 05, 2014 09:27 AM

Hi Ludovic

Great tool. Would be nice if it could show swd pr. day instead of pr. hour (or both). That way it would be easier to get an idea of how many installs occured over time.

You might also want to change 'select top 100 AdvertisementId...' to only incorporate last 30 days (and e.Start > getdate() - 30) otherwise it'll continue to only show 'old' swd's (if they are bigger)

Regards,

Claus

Feb 27, 2014 04:50 AM

Thanks Nic,

I can see the problem just on the first page from your data file [1]:

Connect_SWDTrending.png

The second graph shows very little data - and this is because I am filtering some data that, may be, I shouldn't be filtering:

select AdvertisementName,
       DATEPART(yy, e.Start) as 'Year',
       DATEPART(MM, e.Start) as 'Month',
       DATEPART(DD, e.Start) as 'Day',
       DATEPART(hh, e.Start) as 'Hour',
       COUNT(*) as '#',
       ISNULL(SUM(
           CASE returncode
               WHEN 0 THEN 1
               WHEN 3010 THEN 1
               WHEN 1641 THEN 1
           END), 0) as 'Success',
       SUM(
           CASE returncode
               WHEN 0 THEN 0
               WHEN 3010 THEN 0
               WHEN 1641 THEN 0
               ELSE 1
           END) as 'Error'
  from Evt_AeX_SWD_Execution e
 where e.AdvertisementId = '{0}'
   and e.Start < getdate()
   and e.Start > getdate() - 30
 group by AdvertisementName, DATEPART(yy, e.Start), DATEPART(MM, e.Start), DATEPART(DD, e.Start), DATEPART(hh, e.Start)
 order by DATEPART(yy, e.Start) desc, DATEPART(MM, e.Start) desc, DATEPART(DD, e.Start) desc, DATEPART(hh, e.Start) desc

I put this in place because in large production environment (with ~20k computers) you can have computers that report data from the future (~#!) and also we have computers coming back from a long period off, with lone events reported with a start time way back.

The result of this is that something that runs every 4 hours like the Windows System Assessment Scan shows like a little bump in the middle of a long flat line...

Anyhow, I'm attaching a new version so you can appreciate if you want the filter or not :D.

Here is the usage:

: Generate Javascript without SQL _eventTime filters:
swdexectrending /raw > trending_data.js

: Generate Javascript with SQL _eventTime filters:
swdexectrending > trending_data.js  

[1] https://www.15-cloud.fr/swdtrending/

Feb 26, 2014 07:24 PM

Sure no problem at all happy to help out.

 

Feb 26, 2014 05:16 PM

Hi Nic,

I'm not sure what's the cause of this. I used my tool today on an empty system (well, hierarchy with a few test servers) and the results was quite strange.

 

Would you mind dropping the trending_data.js here? You can sanitize the file of any references to your company name or internal details. I'm more interested by the look of it, rather than the contecnt per say.

Feb 26, 2014 04:31 PM

You are the man! What a surprise, I had no expectations of you rebuilding this just for me (being stuck in the in the Stone Age) Thank you!

 

It works like great and it refreshing to see a report with a good over view of SWD’s statuses.

 

Only odd thing I noticed is that when I generate the trending_data.js file it seems to hiccup enumerating the Chart_Id’s.

 

44 total objects

 

Creates top 1 - 18

  Skips Top 19

Creates Top 20 – 25

  Skips Top 26

Creates Top 27 – 36

  Skips 37 – 41

Creates Top 42

  Skips Top 43

Creates Top 44

 

Just cause a blank page and another page with one chart one it. I am assuming it probably has to do with some sort of inconsistency with the data in my cmdb (joys of inheriting things).

I just wanted to let you know in case it would happen to someone else.

 

Thanks again!

-Nic

Feb 26, 2014 09:35 AM

Hello Nic,

Can you test the attached version? I just built-it against bare SP2 (7.1.8280).

Feb 26, 2014 03:35 AM

I need to re-install the SMP on that server anyway (I broke it in many ways). So I should be able to buld for SP2 by the end of the week.

Stay tuned.

Feb 25, 2014 04:29 PM

I completely understand you are a one man team and attempt to create solutions that are as broad as possible. I just acquired this environment recently and I am diligently attempting to do some cleaning before upgrading to MP 1.1. I will be looking forward to when I get an opportunity\approval to do the update and utilize the SWD trending.

 

Thanks for your Time!

-Nic

Feb 25, 2014 02:57 PM

Hello Nic,

Thanks for the feedback. i truly appreciate it.

Regarding the target build, I used to build for 7.1 SP2 but I mistakenly upgraded to MP1.1 not long ago. This is, I think, the 8400 build series. Now I thought I'd be safe with this, as I wouldn't expect (hope?) to encountered customers below this build.

But you may be proving me wrong ;). Have you not yet upgraded to MP1.1, or installed any of the roll-ups?

As you can imagine I am a very small outfit :D, so I can't build for too many versions.

Feb 25, 2014 01:15 PM

Hi Ludovic!

First I would like to say that I truley appricate all the work you do with your in depth articles and utilites to extend the usefullness of the NS. Thank you!

My question is will this utility work with 7.1 SP2?

I get the the following error when attempting to execute SWDTrending:

C:\inetpub\wwwroot\SWDTrending>SWDExecTrending.exe > trending_data.js
 
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Altiris.NS, Version=7.1.8400.0, Culture=neutral, PublicKeyToken=d516cb311cfb6e4f' or one of its dependencies. The system cannot find the file specified. File name: 'Altiris.NS, Version=7.1.8400.0, Culture=neutral, PublicKeyToken=d516cb311cfb6e4f'                                                                      
  at Symantec.CWoC.APIWrappers.SecurityAPI.user_is_admin()                        
  at Symantec.CWoC.SWDExecTrending.Main(String[] args)                                                                                                         
WRN: Assembly binding logging is turned OFF.                                    
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.                                       
 Note: There is some performance penalty associated with assembly bind failure logging.                                                                          
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].    

I only see Altiris.NS version 7.1.8280 on the server.

Thanks Again!

-Nic

Feb 25, 2014 03:19 AM

Cool,

You are almost there :D. I suspect that you are opening index.html with Internet Explorer.

Now there's a couple of potential issues preventing you from accessing the charts:

  1. You don't have Internet access on the server. In this case the best option is to navigate to the page via your workstations, in your case (and the default case) it will be http://<yourserver>/altiris/ns/swdtrending/
  2. Internet Explorer doesn't allow you to run the ActiveX necesssary

Either way (or if neither apply) let me know!

Feb 25, 2014 02:05 AM

Awesome...got the .js file to generate but is only 77kb, double clicking on the index.html - gives me a blank page..with a home link

i have the both the files in - c:\program files\altiris\notification sever\web\swdtrending

what am i missing?

Thank you,

Vikram

Feb 25, 2014 01:31 AM

Hello Vikram,

The program write the data to stdout. So you need to redirect the output to the desired file path.

For example:

cd "c:\program files\altiris\notification sever\web\swdtrending"
swdtrending > trending_data.js

For the index.html and js, yes, they must reside in the same directory, and the directory should be a folder accessible from the web if you want to access the page via http/https.

Feb 25, 2014 01:13 AM

Hi - wanting to set this up in my environment but i'm sorta missinng something here (stuck in the first step)... i just run the exe file on the NS box and it is supposed to produce the .js file right? which for me is not happening :( 

and then i copy the .js (once i get it to generate) and index.html to my IIS directory?

appreciate your help.

regards,

Vikram

 

Related Entries and Links

No Related Resource entered.