Historical CMS reports delivered by e-mail

Following this discussion (link), here’s the cheap’n’simple way to do that–explained in detail.

Step by step:

1. Create /tmp/reports directory.

2. Create timetables for reports you need, like usual:

2. fill in timetable fields

3. choose report

4. fill in report fields

5. stop timetable and save

3. Repeat creating timetable for every daily report you need to be sent.

4. Create a shell script daily_email.sh in /export/home/cms:

Change directory to /export/home/cms and open a new file in vi editor:

image

Press “a” to add input, copy the script text from a quote below and insert it into terminal window using Shift-Insert keys:

image

The script is as following:

#!/bin/sh

for i in `ls -1 /tmp/reports` ; do mailx -s "fresh report $i" manager@call-center.com < /tmp/reports/$i ; done

rm /tmp/reports/*

It kinda goes without saying that you would need to change “manager@call-center.com” for an actual address of whomever it may concern. :)

Press Esc, then type in “:wq” and press Enter:

image

This command will save the file and quit vi. Next you need to make this script executable by running “chmod” command like this:

image

5. Put this script in crontab by issuing “EDITOR=vi crontab -e” as root:

5. crontab

The last line is what you need:

10 6 * * * [ –x /export/home/cms/daily_email.sh ] && /export/home/cms/daily_email.sh

It tells your CMS server to run the script at 6:10am every day, you can change the time if you don’t like it. Save and quit with “:w!” and “:q” commands respectively.

6. Check that sendmail is running:

6. sendmail

If it’s not, run “/etc/init.d/sendmail start” and check again.

Considering that this requires like half a minute for every report you need to run daily to set up and practically zero maintenance, I fail to see any reason to pay Avaya $$ for their services.

, ,

21 Comments

  • Bel says:

    Oh my gosh this is wonderful!

    I am working in a call centre using CMS R14 or 15 – I have never used a terminal emulator but have been recommended putty Is it really as simple as installing emuator ? How do I bring up a main menu?

    Thanks for any help whatsoever – Please email me

    Bel

    • dwalin says:

      Bel,

      I have sent you an e-mail.

      Regards,
      Alex.

      • Melisse says:

        Alex,

        I realize this posting is quite old, but I was wondering if there are any new options to email reports with the release of CMS 17?

        • dwalin says:

          Hi Melisse,

          I don’t have a copy of CMS R17 around to try it but I don’t see any reason why the approach above shouldn’t work. I’m not aware of any new options in CMS either but then again I’m not working actively with Avaya solutions anymore and it’s hard to keep up to date so maybe I missed something.

          Regards,
          Alex.

          • Melisse says:

            hello.
            Thank you so much for you fast response. I finally had a chance to try it out and i made it to step 5. i tried it a couple of ways at first getting a response of invalid range. Then i changed my entry to =# vi crontab -e and that got me to a entry of “crontab” [New File]
            so then i followed the insert command from before and
            pressed “esc” and then a.
            that gave in the Insert option.
            i then added the statement
            trying for a time of 15 for 3pm and then the remainder of the line.
            when i tried to :w! and :q i got the command:
            “errors in crontab file, can’t install. Do you want to retry the same edit?

            so needless to say, i don’t work at all in this language so i am following as best as i can.
            thoughts?

          • dwalin says:

            Well crontab is not so much of a language, it’s just a configuration file that tells your system to run some programs or scripts at specific time of day. This file has fixed format so you need to pay close attention to what you’re typing; if you look at the screenshot you will see that every string in crontab begins either with # (comment lines), or 5 values separated by spaces: minute, hour, day of month, month, and day of week when the command needs to run. The sixth value is the command that is going to be executed at the specified time.

            The error message you’ve seen means the format of the line you added was wrong; most probably you missed a space somewhere.

            With this in mind, you can try running this command:

            EDITOR=vi crontab -e

            Make sure you type it like this! After vi editor appears as in the screenshot, press G (uppercase g) to place the cursor at the last line of the file, then press A (uppercase a) to add a new line, type the line as in screenshot, press Esc and then :w! (write file), and :q (quit).

            If you do it like that there should be no errors, and you will see output like “new crontab installed”. After that the command will be run automatically even after you reboot CMS system.

            Hope this helps!

            Regards,
            Alex.

  • Heidi says:

    HI!

    I’m very unfamiliar with Unix commands, but think this could be very helpful. I understood how to make the directory you reference in step 1, but when I hit step 4 – creating the shell script I’m lost, is this a new directory I’m creating in the /export/home/cms directory and then using vi to edit and input the command you show?

    Thanks for any help!

    • dwalin says:

      Heidi,

      I have updated the post with more detailed explanations regarding the script creation, please see it above.

      Regards,
      Alex.

  • Alex says:

    Hi Alex,

    One suggestion to clean up your shell script. Instead of running ls -l in your loop, try running ls without switch. Otherwise, the script will throw errors as it reads through the -l output.

    Cheers!

    • dwalin says:

      Alex, I should note that this isn’t “-l” switch in my script, I mean not small letter “l”. It’s actually digit 1, to force “ls” command to print just one file name per line. It may be indistinguishable with your display font, but if you use copy and paste, the result will come out right.
      Thanks for suggestion though, I really appreciate your involvement! Please feel free to share any thoughts, this blog is all about Avaya nooks and crannies. :)

      Regards,
      Alex.

  • Alex says:

    So it is! Thanks, I missed it while reading through your script. Keep up the great blog.

    I’m working on a custom CMS interface at the moment for historical data, and real time data. The historical is relatively simple given that CMS stores it all in Informix (R15) , though from what I have seen thus far with real time, it will be necessary to hook into the RT Sockets. Do you have any experience with real time data polling via the CMS direct?

    Reg.

    Alex

    • dwalin says:

      Alex,

      I can’t say as I have any experience with RT_Socket interface, just didn’t ever need it. I have some understanding of its architecture though, based on a couple of Avaya documents I was able to get. I can share them with you if you want; these documents are for Avaya internal use only but what the heck, everybody’s watching WikiLeaks scandals these days so this will go unnoticed. :) Drop me a line on dwalin [at] dwalin [dot] ru if you want it.
      Speaking of CMS interfaces in general, I think it would be good to have a Web service data provider based on CMS instead of all this nonsense with ODBC and RT_Socket. That would require considerable development effort though and I’m not sure I’d like to do anything like that as a hobby project. Can’t do this now anyway, I’ve lost access to lab CMS along with my ex-job so all CMS-related projects are stalled. :)

      Regards,
      Alex.

  • scisq says:

    I try to use timetable to make a report for ‘agent trace list’ but with no succedd.
    May i asked for help

  • Jim says:

    Hi Alex,

    I understand you are not in this field anymore, but hope you can help. I struggled but successfully got to the point of using the command pkgadd….. but I am getting the following error after entering the command in your instructions and can not install your converter:

    # pkgadd -d http://avaya.dwalin.ru/wp-content/uploads/2010/08/CMSechi-basic-1.5.pkg
    pkgadd: ERROR: Failure occurred with http(s) negotiation:
    pkgadd: ERROR: Unable to download package datastream from .

    Any help would be greatly appreciated.

    Thanks,

    Jim

  • Jim says:

    Not all of the error made in to my post.

    “pkgadd: ERROR: Failure occurred with http(s) negotiation: ”

    “pkgadd: ERROR: Unable to download package datastream from .”

    Thanks,

    Jim

  • Jim says:

    Sorry Alex, it is not showing the text after negotiation or datastream from. Let enter with out the greater than, less than

    # pkgadd -d http://avaya.dwalin.ru/wp-content/uploads/2010/08/CMSechi-basic-1.5.pkg
    pkgadd: ERROR: Failure occurred with http(s) negotiation: Not a HTTP/1.1 server
    pkgadd: ERROR: Unable to download package datastream from http://avaya.dwalin.ru/wp-content/uploads/2010/08/CMSechi-basic-1.5.pkg.

    thanks,

    Jim

  • Bok says:

    Guys,

    This is out of the topic question.. Is there a tool to get rid the panthom call from real-time report of CMS?

    There is a call Waiting of 1 even-tough there are 5 Available agents to take the call. This call waiting doesn’t affect the service level, its just a “stuck” number in a real-time display.

    Thanks,
    Bok

    • dwalin says:

      Hi Bok,

      Try rebooting CMS server, if that doesn’t help then it’s a call for Avaya PSO.

      Regards,
      Alex.

  • Tibor says:

    Hi dwalin,

    I tried to use your tip, but unfortunetly it doesn´t work for me :(
    I think, the problem is with my mail-settings. Perhaps could you help in this topic too?

    Thank you in advance!

    Best regards
    TIbor

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>