{"id":1521,"date":"2013-12-06T16:52:42","date_gmt":"2013-12-06T15:52:42","guid":{"rendered":"http:\/\/www.zarrelli.org\/blog\/?p=1521"},"modified":"2013-12-06T17:38:24","modified_gmt":"2013-12-06T16:38:24","slug":"send_gearman-dirty-wrapper","status":"publish","type":"post","link":"https:\/\/www.zarrelli.org\/blog\/send_gearman-dirty-wrapper\/","title":{"rendered":"send_gearman dirty wrapper"},"content":{"rendered":"<p><span style=\"line-height: 1.5;\">This is just a skeleton. It works but no \u00a0checks on input. It&#8217;s meant to be run by a cronjob, so, really, input check?\u00a0<\/span><\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>#!\/bin\/bash<\/p>\n<p># Mod-Gearman Passive Check Wrapper<br \/>\n# (few lines) coded by Giorgio Zarrelli<\/p>\n<p>COMMAND=`$1`<br \/>\nRETURN_CODE=&#8221;$?&#8221;<br \/>\nSEND_BIN=&#8217;\/path\/to\/send_gearman&#8217;<br \/>\nSERVER=&#8217;gearmand_server_ip:4730&#8242;<br \/>\nHOST=&#8221;my_passive_host_as_in_nagios&#8221;<br \/>\nENCRYTION=&#8221;yes&#8221;<br \/>\nKEY=&#8217;my_secret_key&#8217;<br \/>\nSERVICE=&#8221;$2&#8243;<\/p>\n<p>$SEND_BIN &#8211;server=&#8221;$SERVER&#8221; &#8211;encryption=&#8221;$ENCRYPTION&#8221; &#8211;key=&#8221;$KEY&#8221; &#8211;host=&#8221;$HOST&#8221; &#8211;service=&#8221;$SERVICE&#8221; &#8211;message=&#8221;$COMMAND&#8221; &#8211;returncode=&#8221;$RETURN_CODE&#8221;<\/p>\n<p>So:<\/p>\n<p>.\/send_gearman.sh &#8220;\/path\/to\/nagios\/plugins\/libexec\/check_users -w 1 -c 5&#8221; check-users<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is just a skeleton. It works but no \u00a0checks on input. It&#8217;s meant to be run by a cronjob, so, really, input check?\u00a0 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; #!\/bin\/bash # Mod-Gearman Passive Check Wrapper # (few lines) coded by Giorgio Zarrelli COMMAND=`$1` RETURN_CODE=&#8221;$?&#8221; SEND_BIN=&#8217;\/path\/to\/send_gearman&#8217; SERVER=&#8217;gearmand_server_ip:4730&#8242; HOST=&#8221;my_passive_host_as_in_nagios&#8221; ENCRYTION=&#8221;yes&#8221; KEY=&#8217;my_secret_key&#8217; SERVICE=&#8221;$2&#8243; $SEND_BIN &#8211;server=&#8221;$SERVER&#8221; &#8211;encryption=&#8221;$ENCRYPTION&#8221; &#8211;key=&#8221;$KEY&#8221; &#8211;host=&#8221;$HOST&#8221; &#8211;service=&#8221;$SERVICE&#8221; &#8211;message=&#8221;$COMMAND&#8221; &#8211;returncode=&#8221;$RETURN_CODE&#8221; So: &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62],"tags":[434,432,431,494,433],"class_list":["post-1521","post","type-post","status-publish","format-standard","hentry","category-sysadmin","tag-code","tag-gearmand","tag-mod_gearman","tag-nagios","tag-wrapper","without-featured-image"],"_links":{"self":[{"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/posts\/1521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/comments?post=1521"}],"version-history":[{"count":0,"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/posts\/1521\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/media?parent=1521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/categories?post=1521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/tags?post=1521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}