Skip to content

Commit

Permalink
Revert creating a new node.d.midnightbsd directory and instead modify…
Browse files Browse the repository at this point in the history
… freebsd plugins.
  • Loading branch information
laffer1 committed Jul 8, 2020
1 parent 5f5b618 commit 24d3404
Show file tree
Hide file tree
Showing 22 changed files with 11 additions and 1,443 deletions.
5 changes: 4 additions & 1 deletion Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,11 @@ if ( not $build->install_path('plugins') ) {

$plugins_files->{'plugins/plugin.sh'} = 'plugins/plugin.sh';

# MidnightBSD is similar to FreeBSD, so we also want to include FreeBSD specific plugins here.
my $os = $^O;
$os =~ s/midnightbsd/freebsd/;
File::Find::find( { wanted => \&_find_plugins_wanted },
'plugins/node.d', "plugins/node.d.$^O" );
'plugins/node.d', "plugins/node.d.$os" );

sub _find_plugins_wanted {

Expand Down
1 change: 0 additions & 1 deletion contrib/plugin-gallery/print-gallery.awk
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ BEGIN {
node_dir_map["node.d.hp-ux"] = "Platform HP-UX"
node_dir_map["node.d.java"] = "Platform Java"
node_dir_map["node.d.linux"] = "Platform Linux"
node_dir_map["node.d.midnightbsd"] = "Platform MidnightBSD"
node_dir_map["node.d.netbsd"] = "Platform NetBSD"
node_dir_map["node.d.openbsd"] = "Platform OpenBSD"
node_dir_map["node.d.sunos"] = "Platform SunOS / Solaris"
Expand Down
5 changes: 3 additions & 2 deletions plugins/node.d.freebsd/cpu
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ if [ "$1" = "autoconf" ]; then
fi

if [ "$1" = "config" ]; then

OSV=`$SYSCTL_BIN -n kern.osrelease | cut -f1 -d.`
if [ "$OSV" = "4" ]; then
if [ $(uname -s) = "MidnightBSD" ]; then
STATUNITS=`$SYSCTL_BIN -n kern.clockrate | cut -f13 -d' '`
elif [ "$OSV" = "4" ]; then
STATUNITS=`$SYSCTL_BIN -n kern.clockrate | cut -f16 -d' '`
elif [ "$OSV" -ge "5" ]; then
STATUNITS=`$SYSCTL_BIN -n kern.clockrate | cut -f13 -d' '`
Expand Down
2 changes: 1 addition & 1 deletion plugins/node.d.freebsd/systat
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ EOF
exit 0
fi
ostype=`uname -s`
if [ ${ostype} = "FreeBSD" ]; then
if [ ${ostype} = "FreeBSD" ] || [ ${ostype} = "MidnightBSD" ]; then
echo "yes"
exit 0
fi
Expand Down
6 changes: 3 additions & 3 deletions plugins/node.d.freebsd/vmstat
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
OSV=`/sbin/sysctl -n kern.osrelease | cut -f1 -d.`

if [ "$1" = "autoconf" ]; then
if [ "$OSV" -ge "5" ]; then
if [ $(uname -s) = "MidnightBSD" ] || [ "$OSV" -ge "5" ]; then
/sbin/sysctl -n vm.vmtotal 2>/dev/null >/dev/null
RESULT=$?
NAME=/sbin/sysctl
Expand Down Expand Up @@ -49,7 +49,7 @@ if [ "$1" = "config" ]; then
echo 'graph_vlabel process states'
echo 'graph_category processes'
echo 'graph_info This graph shows number of processes in each state.'
if [ "$OSV" -ge "5" ]; then
if [ $(uname -s) = "MidnightBSD" ] || [ "$OSV" -ge "5" ]; then
echo 'running.label running'
echo 'running.info processes on CPU or waiting for CPU'
echo 'running.type GAUGE'
Expand All @@ -71,7 +71,7 @@ if [ "$1" = "config" ]; then
exit 0
fi

if [ "$OSV" -ge "5" ]; then
if [ $(uname -s) = "MidnightBSD" ] || [ "$OSV" -ge "5" ]; then
/sbin/sysctl -n vm.vmtotal | /usr/bin/awk '
/^Processes:/ {
print "running.value", $3;
Expand Down
100 changes: 0 additions & 100 deletions plugins/node.d.midnightbsd/coretemp

This file was deleted.

103 changes: 0 additions & 103 deletions plugins/node.d.midnightbsd/cpu

This file was deleted.

Loading

0 comments on commit 24d3404

Please sign in to comment.