Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Sparrow - your own script manager

by melezhik (Monk)
on Mar 23, 2017 at 20:06 UTC ( #1185676=CUFP: print w/replies, xml ) Need Help??

Sparrow - script manager. One can easily create and distributes scripts using Sparrow/Outthentic tool chain.

Here are some examples. ( You may find a detailed information at Sparrow docs )

# install sparrow

$ cpanm Sparrow

# create useful script

$ cat story.bash
/etc/init.d/nginx status # tell me if nginx server is running
$ touch story.check

# upload script to SparrowHub repository

$ cat sparrow.json
{
  "name" : "nginx-check",
  "version" : "0.0.1",
  "description" : "nginx check script"
}
$ sparrow plg upload

# run sparrow script at other host

$ ssh 192.168.0.1
$ sparrow plg install nginx-check
$ sparrow plg run  nginx-check

p> nginx-check at 2017-03-23 23:00:27
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
   Active: active (running) since Thu 2017-03-23 23:00:20 MSK; 6s ago
  Process: 10062 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 10060 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 10064 (nginx)
   CGroup: /system.slice/nginx.service
           ├─10064 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
           └─10065 nginx: worker process
ok      scenario succeeded
STATUS  SUCCEED

Interested? You may know more - other plugins ready to use, tasks, cron jobs, check lists, YAML/JSON/Config::General configuration, other languages support and even more! Follow https://sparrowhub.org

Replies are listed 'Best First'.
Re: Sparrow - your own script manager
by Discipulus (Monsignor) on Mar 23, 2017 at 20:39 UTC
    seems cool!

    congratulations melezhik for you work. In an ancient epoch i was used to shot my Perl programs across the network using a central machine... your seems an organic effort for such task.

    i hope i have the time to try Sparrow soon. (I have some problem to see the cpan tester matrix for the current version 0.2.30 anyway)

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
      Hi! Thanks for fast feedback! Let me know if you have issues with Sparrow install , it should be easy due to few dependencies. Not sure why cpantesters failed for last version.

      Regards.

      Alexey

      PS hope you will find Sparrow useful. )))
Re: Sparrow - your own script manager
by FreeBeerReekingMonk (Chaplain) on Mar 26, 2017 at 22:31 UTC
    I gave it a spin, but it did not work for me (Debian)

    fbrm@host:~$ sparrow plg install http-status
    public@http-status is uptodate (0.0.2)
    Installing modules using /home/fbrm/sparrow/plugins/public/http-status/cpanfile
    Complete! Modules were installed into /home/fbrm/sparrow/plugins/public/http-status/local

    fbrm@host:~$ sparrow plg run http_status
    unknown plugin at /home/fbrm/perl5/lib/perl5/Sparrow/Commands/Plugin.pm line 245.
    Sparrow::Commands::Plugin::run_plugin("http_status") called at /home/fbrm/perl5/bin/sparrow line 38
    fbrm@host:~$

    feels very useful, if you can make your own hub, you could use it to pull monitoring to each machine, if required.

    fbrm@host:~$ sparrow plg remove http_status
    plugin is not installed at /home/fbrm/perl5/lib/perl5/Sparrow/Commands/Plugin.pm line 365.
    fbrm@host:~$ sparrow plg install http_status
    unknown plugin at /home/fbrm/perl5/lib/perl5/Sparrow/Commands/Plugin.pm line 198.
    Sparrow::Commands::Plugin::install_plugin("http_status") called at /home/fbrm/perl5/bin/sparrow line 38

    fbrm@host:~$ sparrow plg show http_status
    unknown plugin at /home/fbrm/perl5/lib/perl5/Sparrow/Commands/Plugin.pm line 320.
    fbrm@host:~$

    any recovery from this? (apart from the rm -rf and reinstalling sparrow itself)

      Hi ! Look like you had a typo. You installed http-status ( right name ) , but run http_status , so this way should be fine : $ sparrow plg run http-status --param url=sparrowhub.org
        d'oh! Thanks for pointing that out!

        Thing I see so far:

        sparrow plg man needs an alias: sparrow plg help (and a info alias... for the ones that do not use man anymore)

        Trying to get tasks working. Need to read the manual first...

      "feels very useful, if you can make your own hub, you could use it to pull monitoring to each machine, if required."

      Yeah, I think one day I will release SparrowHub::Repository to make it possible host sparrow plugins in intranet, meanwhile you may use so called private sparrow plugins feature to host sparrow plugins on remote git repositories ... Let me know if it helps. Thanks
      On "make your own hub, you could use ... " - the very simple implementation of it, based on remote git repositories, available to test, please see this post - http://perlmonks.org/?node_id=1190375
Re: Sparrow - your own script manager
by Anonymous Monk on Mar 23, 2017 at 21:51 UTC

    Sparrow - script manager. One can easily create and distributes scripts using Sparrow/Outthentic tool chain.

    As opposed to?

      Hi, I had no intention to design sparrow as competitor against any existed tools. But if you point the one, I may try to highlight the difference if any ...
        I do not feel it is a competitor.. more like... Perl haven where can I get perl programs from, instead of all the other similar platforms that cater to another language, like JS, for example.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://1185676]
Approved by sierpinski
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2018-08-19 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (188 votes). Check out past polls.

    Notices?