My system is Linux, and java is in
/usr/lib64/jvm/java/bin
i copied this code an pasted to a file called JMXCommandLine.java. Then i run this command
javac JMXCommandLine.java
it didn’t gave any errors. It created .class file.
linux-l6al:/usr/lib64/jvm/java/bin # ls -lrt | tail
-rwxr-xr-x 1 root root 51619 Apr 13 2010 extcheck
-rwxr-xr-x 1 root root 51872 Apr 13 2010 apt
-rwxr-xr-x 1 root root 51987 Apr 13 2010 appletviewer
-rwxr-xr-x 1 root root 6347 Apr 13 2010 jcontrol
-rwxr-xr-x 1 root root 92954 Apr 13 2010 javaws
-rwxr-xr-x 1 root root 96 Jul 6 2010 HtmlConverter
lrwxrwxrwx 1 root root 8 Apr 18 19:31 ControlPanel -> jcontrol
-rw-r--r-- 1 root root 18099 Jun 21 11:29 JMXCommandLine.java
-rw-r--r-- 1 root root 1505 Jun 21 11:29 JMXCommandLine$AppConextName.class
-rw-r--r-- 1 root root 11441 Jun 21 11:29 JMXCommandLine.class
linux-l6al:/usr/lib64/jvm/java/bin #
When i run for usage help it showed me this.
linux-l6al:/usr/lib64/jvm/java/bin # java -cp . JMXCommandLine $@
Usage:
[command] -[switch [value]...] [command] [params...]
Switches:
-jmx [jmx-url]
-user [jmx-username]
-pass [jmx-password]
Commands:
getServerVersion
startVHost [vhost]
stopVHost [vhost]
reloadVHostConfig
startAppInstance [vhost:application/appInstance]
touchAppInstance [vhost:application/appInstance]
shutdownAppInstance [vhost:application/appInstance]
startMediaCasterStream [vhost:application/appInstance] [stream-name] [mediacaster-type]
stopMediaCasterStream [vhost:application/appInstance] [stream-name]
resetMediaCasterStream [vhost:application/appInstance] [stream-name]
getConnectionCounts
getConnectionCounts [vhost:application/appInstance]
getConnectionCounts [vhost:application/appInstance] [stream-name]
getIOOutByteRate
getIOOutByteRate [vhost:application/appInstance]
getIOInByteRate
getIOInByteRate [vhost:application/appInstance]
linux-l6al:/usr/lib64/jvm/java/bin #
Now when i am executing with options it gave this error.
linux-l6al:/usr/lib64/jvm/java/bin # java -cp . JMXCommandLine -user admin -pass password getServerVersion
ERROR: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused]
linux-l6al:/usr/lib64/jvm/java/bin #
linux-l6al:/usr/lib64/jvm/java/bin #
linux-l6al:/usr/lib64/jvm/java/bin # java -cp . JMXCommandLine getServerVersion
ERROR: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused]
linux-l6al:/usr/lib64/jvm/java/bin #
As i am not of programing background, What this errors are corresponds to ?
All i need is a way to start and stop the streams using command line tool…
And if my URL is
rtmp://192.168.1.123:1935/testlive/testlive.stream
, whet should be the correct sequence to start stop stream using this app.
Thanks,
Shekar