check_xi_service_snmp low threshold (rrd MRTG also)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

check_xi_service_snmp low threshold (rrd MRTG also)

Post by zaji_nms »

Dear Expert

want to use NagiosXI inbuilt check_xi_service_snmp with lower and high threshold same time in one Service, how possible?

assume we need mild temperature of 20 degree centigrade every time
if going lower than 18 WARNING, if going lower than 16 CRITICAL
same way
if going higher than 22 WARNING, if going higher than 24 CRITICAL
how possible in this below

-o '1.3.6.1.4.1.x.x.x.x.x' -C 'public' -P 2c -wl 18 -cl 16 -wh 22 -ch 24

the above is u can say guideline , pseudo code.
-wl = Warning Lower
-cl = Critical Lower
-wh = Warning High
-ch = Critical High

please modify above $ARG1$ in true way

regards
Last edited by zaji_nms on Fri Jun 12, 2020 4:56 pm, edited 1 time in total.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: check_xi_service_snmp threshold

Post by cdienger »

check_xi_service_snmp is a command definition which uses the check_snmp plugin.

The check_snmp plugin can specify a range using the -w and -c options

Ranges can be defined as described in https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT.

This should do the trick:

Code: Select all

 -o '1.3.6.1.4.1.x.x.x.x.x' -C 'public' -P 2c -w 18:22 -c 16:24 
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: check_xi_service_snmp threshold

Post by zaji_nms »

thanks for trick....will see how its works.
just want to clear for other users too, its like this or that (This:That)
if temperature is gone down to 18 or shoot upto 22 --- Warning
if temperature went down to 16 or shooted to 24 --- Critical

okay then can you do something for MRTG
$USER1$/check_rrdtraf -f /var/lib/mrtg/$ARG1$ -w $ARG2$ -c $ARG3$ -l $ARG4$

its perfectly working for Higher bandwidth, is there anyway to set Lower Threshold, is there any trick here too?

if not, then please consider for minor feature request in NagiosXI 6.0
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_xi_service_snmp threshold

Post by ssax »

Code: Select all

-w 18:22 -c 16:24 
This means it will warn if below 18 and critical if below 16.
This also means warn if higher than 22 and critical if higher than 24

check_rrdtraf supports the same threshold format, please read here to see the examples:

https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: check_xi_service_snmp threshold also in rrdtraf

Post by zaji_nms »

dear ssax

no.....for MRTG the lower threshold not working

[nagios@ ~]$ /usr/local/nagios/libexec/check_rrdtraf -f /var/lib/mrtg/myrouter_903.rrd -w 1:2,1:2 -c .5:2.5,.5:2.5 -l M
OK (903) Current BW in: .01Mbps Out: .04Mbps|in=.015851Mb/s;1:2;.5:2.5 out=.046342Mb/s;1:2;.5:2.5

It should give CRITICAL - Low , but looks not working or you have to give some idea.

$ARG2$ = 1:2,1:2
$ARG3$ = .5:2.5,.5:2.5

I want to set WARNING if less then <1Mbps or >2Mbps
CRITICAL if less than <.5Mbps or >2.5Mbps

regards
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_xi_service_snmp threshold

Post by ssax »

It's working properly on mine, what version of the plugin are you using? (mine is 0.5)

/usr/local/nagios/libexec/check_rrdtraf -V

Code: Select all

[root@xid ~]# /usr/local/nagios/libexec/check_rrdtraf -f /var/lib/mrtg/192.168.X.X_XXXX.rrd -w 1:2,1:2 -c .5:2.5,.5:2.5 -l M
CRITICAL - Current BW in: .97Mbps Out: 13.79Mbps|in=.977452Mb/s;1:2;.5:2.5 out=13.794772Mb/s;1:2;.5:2.5
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: check_xi_service_snmp threshold also RRD MRTG

Post by zaji_nms »

dear ssax

mine is same

[root@] /usr/local/nagios/libexec/check_rrdtraf -V
check_rrdtraf v0.5

in your example its CRITICAL due to High Utilization.....plz test on LOW Warning and LOW Critical

Regards
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_xi_service_snmp threshold

Post by ssax »

See here, it also works:

Code: Select all

[root@xid tmp]# /usr/local/nagios/libexec/check_rrdtraf -f /var/lib/mrtg/192.168.5.89_10135.rrd -w 1:30,1.27:30 -c 1:30,1:30 -l M
WARNING - Current BW in: 4.11Mbps Out: 1.26Mbps|in=4.111375Mb/s;1:30;1:30 out=1.260709Mb/s;1.27:30;1:30

Code: Select all

[root@xid tmp]# /usr/local/nagios/libexec/check_rrdtraf -f /var/lib/mrtg/192.168.5.89_10135.rrd -w 1:30,1:30 -c 1:30,1.27:30 -l M
CRITICAL - Current BW in: 4.11Mbps Out: 1.26Mbps|in=4.111375Mb/s;1:30;1:30 out=1.260709Mb/s;1:30;1.27:30
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: check_xi_service_snmp threshold

Post by zaji_nms »

sorry, not working, checked with one of my friend having XI5.6.7, he said not working too.

[root]# ./check_rrdtraf -f /var/lib/mrtg/myrouter_533.rrd -w 10:900,10:900 -c 5:950,5:950
(standard_in) 1: illegal character: :
(standard_in) 1: syntax error
(standard_in) 1: illegal character: :
(standard_in) 1: syntax error
./check_rrdtraf: line 306: [: too many arguments
(standard_in) 1: illegal character: :
(standard_in) 1: syntax error
(standard_in) 1: illegal character: :
(standard_in) 1: syntax error
./check_rrdtraf: line 311: [: too many arguments
OK Current BW in: 9.68Mbps Out: 19.08Mbps|in=9.685676Mb/s;10:900;20:950 out=19.089516Mb/s;10:900;20:950
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_xi_service_snmp threshold

Post by ssax »

Please send me these files:

Code: Select all

/usr/local/nagios/libexec/check_rrdtraf
/usr/local/nagios/libexec/utils.sh
Locked