aravind.kalla has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am looking for Perl solutions where I need to read JSON configuration file containing linux server details and connected oracle DB information,
read this and run several Alert scripts on these DB's...say 100 Linux servers each hosting 4 oracle DB...The process is currently working in a serial manner.

i.e. reads the json file for {1st Linux server->1st DB-> Run Alert scripts.}
1st Linux server->2nd DB-> Run Alert scripts.
...3rd DB
...4th DB

Then reads the json file for {2nd Linux server ->1st DB-> Run Alert scripts}
2nd Linux server->2nd DB-> Run Alert scripts.
...3rd DB
...4th DB

and so on for next 100 (linux servers) * 4 (DBS) = 400 (hosts to monitor.)

This is again connected to a scheduling tool crontab for every 60 mins... but since its running serially for all 100 servers its taking nearly 90 mins ....and hence the second run overlapping the first run. Looking for robust parallel solutions!!!!

  • Comment on Run multiple alert monitoring perl scripts on several Linux machines hosting multiple oracle DB

Replies are listed 'Best First'.
Re: Run multiple alert monitoring perl scripts on several Linux machines hosting multiple oracle DB
by hippo (Archbishop) on Sep 25, 2017 at 22:21 UTC

    You haven't said which protocol you are using to connect to the remote servers, but if it is ssh then Net::OpenSSH::Parallel should be the first place to look. If that doesn't fit the bill for some reason, say why in detail and maybe something else can be suggested.

      Thanks for reply... we have an rsa public key authentication...from the central linux machine to all the linux nodes.

        Hello aravind.kalla,

        Regarding the "we have an rsa public key authentication" on the proposed sample of code that I posted on your question contains:

        Attention!!! in my example I am using ssh key exchange, in case you are not using that uncomment the psw on add user (password) and comment out the (key_path)..

        I think if you spend 30 seconds reading the proposed sample of code you will see that part, as I said it is 60%-70% of your solution is implemented already, if you choose to use this module.

        Hope this helps, BR.

        Seeking for Perl wisdom...on the process of learning...not there...yet!
Re: Run multiple alert monitoring perl scripts on several Linux machines hosting multiple oracle DB
by karlgoethebier (Abbot) on Sep 26, 2017 at 10:07 UTC
    "... for next 100 ... 400 (hosts to monitor.)"

    Nagios, Icinga? Perhaps distributed monitoring?

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Re: Run multiple alert monitoring perl scripts on several Linux machines hosting multiple oracle DB
by thanos1983 (Parson) on Sep 26, 2017 at 06:52 UTC

    Hello aravind.kalla,

    Welcome to the Monastery. I would agree with the fellow Monk hippo for my point of view I would use Net::OpenSSH::Parallel.

    Some time ago another monk asked a "similar" question, by similar I mean that the solution to this question is 60%-70% of your solution, here is a full example with code on how to implement that Re: multiple machines disk space alert.

    If this is still not enough to get you started then read this How do I post a question effectively? and modify your question accordingly.

    Hope this helps, BR.

    Seeking for Perl wisdom...on the process of learning...not there...yet!
      I tried for several servers to run a Linux command on multiple machines...it works. But I am also looking to run perl scripts on multiple machines, which fails when passed as part of commands, is there any way to run perl scripts parallely.

        In your first post you say you're trying to monitor multiple oracle instances per server, for hundreds of servers. Are you now saying that in addition to this you need to run perl scripts on stored on each host? Some clarity in your requirements may help, meanwhile have you see MCE?

Re: Run multiple alert monitoring perl scripts on several Linux machines hosting multiple oracle DB
by Anonymous Monk on Sep 26, 2017 at 13:11 UTC
    Nagios is hard to beat because it provides a nice, convenient framework for the monitoring of anything and for gathering and observing the data. You simply write a data-gathering plugin to monitor exactly what you need. You do not have to write the rest of it.

      As part of future enhancement the perl monitoring script will provide extended feature as data gathering to HP's OMi via SNMP traps.
      So this script has to have the generic build to extend support to any monitoring tool in future in the event of change in monitoring tools.