This post is more than 5 years old

5 Posts

1074

October 22nd, 2012 07:00

Old content?

Well, here we have a brand new area, and that's great.  I am wondering if old content will be migrated over here, or if there is a way to look through it.

I actually have a question about a script that I downloaded (I believe Karl wrote it).  I'll include it below.  It worked for a few days, and then all of a sudden it stopped working.

--- The error:

./test.sh: line 1: use: command not found

./test.sh: line 2: syntax error near unexpected token `('

./test.sh: line 2: `$session = eval{InCharge::session->new('

--------- The script

use InCharge::session;

$session = eval{InCharge::session->new(

server=>'CMA-AM-PM',

)};

# use to determine if instrumentation is present and working

#$UTIL{Disk} = 'Status';

#$UTIL{Interface} = 'CurrentUtilization';

#$UTIL{Port} = 'CurrentUtilization';

$UTIL{FileSystem} = 'UtilizationPct';

#$UTIL{Processor} = 'CurrentUtilization';

#$UTIL{Memory} = 'FreeMemoryPct';

@UCS = $session->getInstances('UnitaryComputerSystem');

foreach $ucs (sort @UCS) {

$obj = $session->object($ucs);

$class = $obj->{CreationClassName};

print "\n$class $ucs\n";

foreach $if (sort @{$obj->{ComposedOf}}) {

  ($vclass, $vname) = split /::/,$if;

  $ifobj=$session->object($if);

  $util = $ifobj->{$UTIL{$vclass}};

  if ($util ne '') {

   print "\t$ifobj->{DisplayName}\t$util\n";

  }

}

}

Any ideas?  Much appreciated!

Don

6 Posts

October 22nd, 2012 10:00

Don,

You should be using sm_perl which is in the directory you mention. You

could issue the command from the command line as well.

sm_perl test.sh

Let me know if this works for you.

Thanks,

Dave

6 Posts

October 22nd, 2012 09:00

Don,

On a quick look it appears that perl isn't in the path (which is why

"use" isn't recognized). I'm not sure what OS you're using but you could

add it to the first statement in the script using Unix syntax or ensure

it's in your path statement on other OS's

#!/(path to smarts perl).

It also appears that the domain has a comma after it, which won't work (I

don't believe as perl will expect further parameters). I'm assuming that

you removed the userid/password or other parameters from the snippet you

sent.

Please let me know if I missed the mark.

Thanks,

Dave

29 Posts

October 22nd, 2012 09:00

Hi Don!

The new URL for our community includes all of the content from the original site.  Our Smarts Community has two locations.  The discussion you have posted today is located in the public area of the ECN Smarts Community - which is accessible by anyone who has an ECN log in.  There is also the private Smarts User Group area where others are posting information they wish only to share with those who have registed to become a Smarts User Group member.

Regards,

Christina   

5 Posts

October 22nd, 2012 10:00

Hi Dave:

Thank you so much for your quick reply.  I am using Red Hat

I added the line

#!/opt/InCharge/IP/smarts/perl

[root@spnssr27.miscny.nyenet_Prod: /opt/InCharge/IP/smarts/bin]# ./test.sh

-bash: ./test.sh: /opt/InCharge/IP/smarts/perl: bad interpreter: Permission denied

I removed that comma, as you suggested, but am now a little confused.  I ran this script successfully without any username or password information.  I don't recall any instructions from Karl in his initial email stating that these are required.

Thank again for your help.

Don

5 Posts

October 22nd, 2012 10:00

Hi Christina:

Ok, that makes a certain amount of sense.  I assume then that my account doesn't have permission to that area, and I suppose I will need to request it.  Per your email of 8/24/12, I thought that I had the access. 

If I do indeed have the correct access, I guess I am too thick skulled to find the secret area, and will need guidance.

Thank you for your quick reply!

Don

5 Posts

October 22nd, 2012 10:00

Worked like a champ.  Thank you.  I don't know why I thought just calling the script would load the interpreter automatically.

Don

5 Posts

October 22nd, 2012 10:00

I found it!

Thank you, Christina.

Don Howe

NYSDOH Medicaid Data Warehouse Replacement & OHIP Data Mart Operational Support Contract

CMA Consulting Services | 11 Corporate Woods, Albany NY 12211

Office: 518.649.4319 | Fax: 518.649.4291

Email: dhowe@cma.com

IMPORTANT NOTICE: This e-mail and any attachments may contain confidential or sensitive information which is, or may be, legally privileged or otherwise protected by law from further disclosure. It is intended only for the addressee. If you received this in error or from someone who was not authorized to send it to you, please do not distribute, copy or use it or any attachments. Please notify the sender immediately by reply e-mail and delete this from your system. Thank you for your cooperation.

No Events found!

Top