Hi,
I need to use macro $HOSTDISPLAYNAME$ in the cmd line look like below.
But when I test the command I found $HOSTDISPLAYNAME$ not resolve to real value. Can I work with macro in cmd?
Thanks.
macro in cmd line
macro in cmd line
You do not have the required permissions to view the files attached to this post.
Re: macro in cmd line
Hi
Could you please provide the check_rrdtraf_ruijie.php file?
Thanks
Could you please provide the check_rrdtraf_ruijie.php file?
Thanks
Re: macro in cmd line
Code: Select all
#!/usr/bin/php
<?php
define( "OK", 0);
define( "WARNING", 1);
define( "CRITICAL", 2);
define( "UNKNOWN", 3);
$on_warning = false;
$on_critical = false;
$opciones = getopt("a:A:");
if( isset($opciones['a']) )
$host_display_name = $opciones['a'];
else if( isset($opciones['A']) )
$host_display_name = $opciones['A'];
$host_display_name = trim($host_display_name);
if($host_display_name == ""){
printf("Please fill Host Display Name\n");
exit(UNKNOWN);
}
printf("OK - ".$host_display_name." Current BW in: 0Mbps Out: .01Mbps|in=0Mb/s;15;20 out=0Mb/s;5;8");
exit(OK);
?>-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: macro in cmd line
Hi,
Thanks for sharing the script. We're are currently working on your issue. We are going to do a bit of research on it and get back to you within 24 hours.
Thanks,
Benjamin
Thanks for sharing the script. We're are currently working on your issue. We are going to do a bit of research on it and get back to you within 24 hours.
Thanks,
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: macro in cmd line
Hi
There is no $HOSTDISPLAYNAME$ macro.
Please try using $HOSTNAME$
for example:
gregtest.php file:
command definition:
service definition:
run command check:
Please let me know how you make out.
Thanks
There is no $HOSTDISPLAYNAME$ macro.
Please try using $HOSTNAME$
for example:
gregtest.php file:
Code: Select all
#!/usr/bin/php
<?php
define( "OK", 0);
define( "WARNING", 1);
define( "CRITICAL", 2);
define( "UNKNOWN", 3);
$on_warning = false;
$on_critical = false;
$opciones = getopt("a:A:");
if( isset($opciones['a']) )
$host_display_name = $opciones['a'];
else if( isset($opciones['A']) )
$host_display_name = $opciones['A'];
var_dump($host_display_name);
$host_display_name = trim($host_display_name);
printf($host_display_name);
if($host_display_name == ""){
printf("Please fill Host Display Name\n");
exit(UNKNOWN);
}
printf("OK - ".$host_display_name." Current BW in: 0Mbps Out: .01Mbps|in=0Mb/s;15;20 out=0Mb/s;5;8");
exit(OK);
?>
Thanks
You do not have the required permissions to view the files attached to this post.