3

Hello (I'm no hard core coder:),

I try to develop a script to do some very basic monitoring on an IBM SVC.

My goal is to get some information about the nodes and my quroum status and then send this information by mail.

here's my code so far (I understood that grep command doesn't "work" on CLI for SVC).

#check nodes of the cluster with lsnodes and parse status
ssh admin@SVCName superuser>svcinfo lsnode | while read id name sn wwnn status temp;do echo $name" "$status;done

#check quorum status with lsquorum and parse status
ssh admin@SVCName superuser>svcinfo lsquorum | while read quorum_index status id name controller_id controller_name active temp; do echo $controller_name" "$active;done

My problem is sending an email from the CLI to designed users. I don't find any valuable information anywhere on the internet.

HINT: this script will be deployed on a jumppoint server (probably a windows server) in production, I cannot allow the installation of any exectution environment such as cigwin or perl or anything).

Could you help me with that ?

  • If you'll be running that on a Windows machine where you can't install software at all, you're out of luck: there was no SSH client on Windows machines last time I checked, you need to install one yourself. With what you have above (if it worked), all the output would be on that "jumppoint" server, thus the email would have to come from there, and scripting that is off-topic here if it's a Windows machine. (I'm not sure there's a facility on the V7000 to send random email directly from the CLI.) Please clarify your question wrt these points. – Mat Apr 23 '13 at 12:13
  • Hello, thanks for your answer. I forgot to mention that on my windows server, there is Putty installed, which allows me to run SSH commands to the SVC. My initial question was to be sure that there was no possibility to send emails from the CLI of the SVC. I'm afraid I'm running our of ideas now, except than emailing directly from the windows server. Thanks anyway. – Foxillon Apr 26 '13 at 9:07
0

You can try this function to implement grep on SVC or V7K Family

grep () { IFS=$'\n'; op='=='; if [[ $1 == '-v' ]]; then op='!='; shift; fi; while read l; do eval "[[ \$l $op *\$@* ]]" && echo $l; done }

And use as normal grep with | (pipe) has some limitations but is very useful.

Hope could help. My two cents.

0

Try this. It's a Nagios plug-in in the form of a perl script. You don't need much knowmedge of this language to use it. Just run it without any arguments to get it's help. If it doesn't fit your needs check other ones here.

Notice: you may have to install some packages (espaecially the IBM SVC perl library) for get it to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.