Hi Kathleen,

If you’d like to run riak_nagios from the erl command line, you’ll need to 
compile everything in src and include it in the path along with the getopt 
library.   

You can compile everything with a simple call to make, and then include it in 
the path with "erl -pa deps/*/ebin ebin”.  
Once everything is loaded, you can call "check_node:main(["--node", 
"dev1@127.0.0.1", "riak_kv_up"]).” or something similar to run it.  The last 
parameter in the Args array will be the check to make.  

Is there a reason you’re running it this way instead of compiling it to an 
escript and running it from bash? 

Thanks,
Alex Moore

On December 10, 2013 at 1:26:20 PM, kzhang (kzh...@wayfair.com) wrote:

Thanks Hector.  

Here is how I executed the script.  

I downloaded and installed the erlang shell from  
http://www.erlang.org/documentation/doc-5.3/doc/getting_started/getting_started.html
  

started erlang OTP:  

root@MYRIAKNODE otp_src_R16B02]# erl -s toolbar  
Erlang R16B02 (erts-5.10.3) [source] [64-bit] [async-threads:10] [hipe]  
[kernel-poll:false]  

Eshell V5.10.3 (abort with ^G)  

grabbed the source code  
(https://github.com/basho/riak_nagios/blob/master/src/check_node.erl),  
compiled it:  
c(check_node).  

ran it:  
check_node:main([{node, 'xx.xx.xx.xx'}]).               

then got:  

** exception error: undefined function getopt:parse/2  
in function check_node:main/2 (check_node.erl, line 15)  

Here is where I am. I found this:  

https://github.com/jcomellas/getopt  

I grabbed the source code, compiled it under otp_src_R16B02.  

ran it again:  
2> check_node:main([{node, 'xx.xx.xx.xx'}]).  
UNKNOWN: invalid_option_arg {check,{node,'xx.xx.xx.xx'}}  

Am I on the right path?  

Thanks,  

Kathleen  












--  
View this message in context: 
http://riak-users.197444.n3.nabble.com/riak-nagios-script-tp4030025p4030037.html
  
Sent from the Riak Users mailing list archive at Nabble.com.  

_______________________________________________  
riak-users mailing list  
riak-users@lists.basho.com  
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com  
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to